#ifndef __meowpp_h__ #define __meowpp_h__ #include "Usage.h" #include "utility.h" #include "colors/RGB.h" #include "colors/YUV.h" #include "colors/HSL.h" #include "colors/HSV.h" #include "dsa/DisjointSet.h" #include "dsa/KD_Tree.h" #include "dsa/VP_Tree.h" #include "dsa/SegmentTree.h" #include "dsa/BinaryIndexTree.h" #include "dsa/MergeableHeap.h" #include "dsa/SplayTree.h" #include "dsa/SplayTree_Range.h" #include "oo/Register_Implement.h" extern meow::Usage usg, usg2; extern int count; ////////////////////////////////// class TestFunctions: public meow::RegisterInterface{ public: TestFunctions(): RegisterInterface(){ usg2.addOption('t', "Specify which part of the template to test", "name", "", false); } bool regImplement(meow::ImplementInterface* imp, std::string const& str){ usg2.addOptionValueAccept('t', meow::stringPrintf("%d", imp->identify()), str); return RegisterInterface::regImplement(imp); } }; extern TestFunctions tests; //////////////////////// class TestFunction: public meow::ImplementInterface{ private: std::string _name; public: TestFunction(std::string const& __name): ImplementInterface(count++), _name("testing code about " + __name){ tests.regImplement(this, _name); } virtual ~TestFunction(){ } virtual bool run() = 0; std::string name() const{ return _name; } }; //////////////////////// #define concat(a,b) a##b #define TEST(a) \ class Test_##a: public TestFunction{ \ public: \ Test_##a(): TestFunction(#a){ } \ bool run();\ } __test_##a; bool Test_##a::run() #endif // meowpp_h__