]> 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 ae459f573b76f66bf5d9ec9df3240d49095326cb..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);
@@ -83,6 +91,7 @@ protected:
 
        void info(const std::string &);
        void debug(const std::string &);
+       void fail(const std::string &);
 };
 
 template<typename T>