34 TestType* p_test =
new TestType;
87 virtual void ResetResult();
93 virtual void Profile();
95 virtual void TearDown();
97 virtual void Enable();
99 virtual void Disable();
101 virtual void Select();
103 virtual void UnSelect();
109 const std::string& Name()
const;
115 void SetResultOutput(std::string
const& TheResultOutput);
121 virtual bool IsEnabled()
const;
123 virtual bool IsDisabled()
const;
125 virtual bool IsSelected()
const;
127 virtual bool IsDistributedTest()
const;
134 virtual std::string
Info()
const;
137 virtual void PrintInfo(std::ostream& rOStream)
const;
140 virtual void PrintData(std::ostream& rOStream)
const;
151 const std::string mName;
163 virtual void TestFunction() = 0;
178 rOStream << std::endl;
188 #define KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName) \
191 #define KRATOS_TESTING_CONVERT_TO_STRING(Name) #Name
193 #define KRATOS_TESTING_TEST_CASE_CLASS_BODY(TestCaseName,ParentName) \
195 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)() : ParentName(KRATOS_TESTING_CONVERT_TO_STRING(Test##TestCaseName)) {}\
197 void TestFunction() override; \
198 static const Internals::RegisterThisTest< KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName) > mDummy;
200 #define KRATOS_TESTING_TEST_CASE_CLASS(TestCaseName,ParentName) \
201 class KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName) : public ParentName \
203 KRATOS_TESTING_TEST_CASE_CLASS_BODY(TestCaseName,ParentName) \
221 #define KRATOS_TEST_CASE(TestCaseName) \
222 KRATOS_TESTING_TEST_CASE_CLASS(TestCaseName, TestCase) \
223 const Kratos::Testing::Internals::RegisterThisTest< KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName) > \
224 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy; \
226 void KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::TestFunction()
228 #define KRATOS_DISABLED_TEST_CASE(TestCaseName) \
229 KRATOS_TESTING_TEST_CASE_CLASS(TestCaseName, TestCase) \
230 const Kratos::Testing::Internals::RegisterThisTest< KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName) > \
231 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy(true); \
233 void KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::TestFunction()
246 #define KRATOS_TEST_FIXTURE(TestFixtureName) \
247 class TestFixtureName : public TestCase \
250 TestFixtureName(std::string const& Name) : TestCase(Name) {}\
252 void Setup() override; \
253 void TearDown() override; \
256 #define KRATOS_TEST_FIXTURE_SETUP(TestFixtureName) \
257 void TestFixtureName::Setup()
259 #define KRATOS_TEST_FIXTURE_TEAR_DOWN(TestFixtureName) \
260 void TestFixtureName::TearDown()
262 #define KRATOS_TEST_CASE_WITH_FIXTURE(TestCaseName,TestFixtureName) \
263 KRATOS_TESTING_TEST_CASE_CLASS(TestCaseName, TestFixtureName) \
264 const Kratos::Testing::Internals::RegisterThisTest< KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName) > \
265 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy; \
267 void KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::TestFunction()
269 #define KRATOS_DISABLED_TEST_CASE_WITH_FIXTURE(TestCaseName,TestFixtureName) \
270 KRATOS_TESTING_TEST_CASE_CLASS(TestCaseName, TestFixtureName) \
271 const Kratos::Testing::Internals::RegisterThisTest< KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName) > \
272 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy(true); \
274 void KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::TestFunction()
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Definition: test_case.h:30
RegisterThisTest(bool IsDisabled=false)
Definition: test_case.h:32
The test case base class.
Definition: test_case.h:53
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: test_case.cpp:178
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: test_case.cpp:183
TestCase()=delete
TestCase cannot be created without a name.
TestCase(TestCase const &rOther)=delete
The TestCase cannot be copied to avoid duplications.
TestCase & operator=(TestCase const &rOther)=delete
Preventing the assignment of the tests.
The test case base class.
Definition: test_case_result.h:37
static void AddTestCase(TestCase *pHeapAllocatedTestCase)
Definition: tester.cpp:134
std::ostream & operator<<(std::ostream &rOStream, const TestCase &rThis)
output stream function
Definition: test_case.h:174
Definition: distributed_test_case.cpp:24
def Run()
Definition: convection_diffusion_benchmarks.py:9