]> git.tdb.fi Git - libs/test.git/blobdiff - source/test.h
Support passing a parameter to a test function
[libs/test.git] / source / test.h
index d410377c4793102bb90525d6246fe77e5ca31b80..0b12dbefa9a6a16d4c7534e55cc09bf6c2cfe886 100644 (file)
@@ -43,6 +43,7 @@ private:
        std::list<Function *> functions;
        std::string detail_info;
        std::string detail_debug;
+       std::string fail_reason;
        bool passed;
 
 protected:
@@ -60,6 +61,13 @@ protected:
                return *functions.back();
        }
 
+       template<typename T, typename A>
+       Function &add(void (T::*f)(A), const A &a, const std::string &d)
+       {
+               functions.push_back(new TypedFunction1<T, A>(f, a, d));
+               return *functions.back();
+       }
+
 public:
        static void run_single(const std::string &, bool);
        static void run_all(bool);