30 std::string
const& TestName, std::string
const& TestSuiteName) {
65 explicit TestSuite(std::string
const& Name);
81 void AddTestCase(
TestCase* pTestCase);
83 void Reset()
override;
85 void ResetResult()
override;
89 void Profile()
override;
91 void Enable()
override;
93 void Disable()
override;
95 void Select()
override;
97 void UnSelect()
override;
112 virtual std::string
Info()
const override;
115 virtual void PrintInfo(std::ostream& rOStream)
const override;
118 virtual void PrintData(std::ostream& rOStream)
const override;
131 void TestFunction()
override;
147 std::ostream& rOStream,
const TestSuite& rThis) {
149 rOStream << std::endl;
158 #define KRATOS_TESTING_CONCATENATE(a, b) a##b
160 #define KRATOS_TESTING_CREATE_DUMMY_VARIABLE_NAME(prefix, UniqueNumber) \
161 KRATOS_TESTING_CONCATENATE(prefix, UniqueNumber)
163 #define KRATOS_TESTING_ADD_TEST_TO_TEST_SUITE(TestName, TestSuiteName) \
164 Kratos::Testing::Internals::AddThisTestToTestSuite \
165 KRATOS_TESTING_CREATE_DUMMY_VARIABLE_NAME(dummy, __LINE__)( \
166 TestName, TestSuiteName)
168 #define KRATOS_TESTING_TEST_CASE_IN_SUITE_CLASS(TestCaseName, ParentName) \
169 class KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName) : public ParentName { \
170 KRATOS_TESTING_TEST_CASE_CLASS_BODY(TestCaseName, ParentName) \
171 static const Kratos::Testing::Internals::AddThisTestToTestSuite \
176 #define KRATOS_TEST_CASE_IN_SUITE(TestCaseName, TestSuiteName) \
177 KRATOS_TESTING_TEST_CASE_IN_SUITE_CLASS(TestCaseName, TestCase) \
178 const Kratos::Testing::Internals::RegisterThisTest< \
179 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)> \
180 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy; \
181 const Kratos::Testing::Internals::AddThisTestToTestSuite \
182 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mAnotherDummy = \
183 Kratos::Testing::Internals::AddThisTestToTestSuite( \
184 KRATOS_TESTING_CONVERT_TO_STRING(Test##TestCaseName), \
185 KRATOS_TESTING_CONVERT_TO_STRING(TestSuiteName)); \
187 void KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::TestFunction()
190 #define KRATOS_DISABLED_TEST_CASE_IN_SUITE(TestCaseName, TestSuiteName) \
191 KRATOS_TESTING_TEST_CASE_IN_SUITE_CLASS(TestCaseName, TestCase) \
192 const Kratos::Testing::Internals::RegisterThisTest< \
193 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)> \
194 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy(true); \
195 const Kratos::Testing::Internals::AddThisTestToTestSuite \
196 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mAnotherDummy = \
197 Kratos::Testing::Internals::AddThisTestToTestSuite( \
198 KRATOS_TESTING_CONVERT_TO_STRING(Test##TestCaseName), \
199 KRATOS_TESTING_CONVERT_TO_STRING(TestSuiteName)); \
201 void KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::TestFunction()
204 #define KRATOS_DISTRIBUTED_TEST_CASE_IN_SUITE(TestCaseName, TestSuiteName) \
205 KRATOS_TESTING_TEST_CASE_IN_SUITE_CLASS(TestCaseName, DistributedTestCase) \
206 const Kratos::Testing::Internals::RegisterThisTest< \
207 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)> \
208 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy; \
209 const Kratos::Testing::Internals::AddThisTestToTestSuite \
210 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mAnotherDummy = \
211 Kratos::Testing::Internals::AddThisTestToTestSuite( \
212 KRATOS_TESTING_CONVERT_TO_STRING(Test##TestCaseName), \
213 KRATOS_TESTING_CONVERT_TO_STRING(TestSuiteName)); \
215 void KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::TestFunction()
218 #define KRATOS_DISABLED_DISTRIBUTED_TEST_CASE_IN_SUITE(TestCaseName, TestSuiteName) \
219 KRATOS_TESTING_TEST_CASE_IN_SUITE_CLASS(TestCaseName, DistributedTestCase) \
220 const Kratos::Testing::Internals::RegisterThisTest< \
221 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)> \
222 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy(true); \
223 const Kratos::Testing::Internals::AddThisTestToTestSuite \
224 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mAnotherDummy = \
225 Kratos::Testing::Internals::AddThisTestToTestSuite( \
226 KRATOS_TESTING_CONVERT_TO_STRING(Test##TestCaseName), \
227 KRATOS_TESTING_CONVERT_TO_STRING(TestSuiteName)); \
229 void KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::TestFunction()
231 #define KRATOS_TEST_CASE_WITH_FIXTURE_IN_SUITE( \
232 TestCaseName, TestFixtureName, TestSuiteName) \
233 KRATOS_TESTING_TEST_CASE_IN_SUITE_CLASS(TestCaseName, TestFixtureName) \
234 const Kratos::Testing::Internals::RegisterThisTest< \
235 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)> \
236 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy; \
237 const Kratos::Testing::Internals::AddThisTestToTestSuite \
238 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mAnotherDummy = \
239 Kratos::Testing::Internals::AddThisTestToTestSuite( \
240 KRATOS_TESTING_CONVERT_TO_STRING(Test##TestCaseName), \
241 KRATOS_TESTING_CONVERT_TO_STRING(TestSuiteName)); \
243 void KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::TestFunction()
245 #define KRATOS_DISABLED_TEST_CASE_WITH_FIXTURE_IN_SUITE( \
246 TestCaseName, TestFixtureName, TestSuiteName) \
247 KRATOS_TESTING_TEST_CASE_IN_SUITE_CLASS(TestCaseName, TestFixtureName) \
248 const Kratos::Testing::Internals::RegisterThisTest< \
249 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)> \
250 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy(true); \
251 const Kratos::Testing::Internals::AddThisTestToTestSuite \
252 KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mAnotherDummy = \
253 Kratos::Testing::Internals::AddThisTestToTestSuite( \
254 KRATOS_TESTING_CONVERT_TO_STRING(Test##TestCaseName), \
255 KRATOS_TESTING_CONVERT_TO_STRING(TestSuiteName)); \
257 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_suite.h:27
AddThisTestToTestSuite(std::string const &TestName, std::string const &TestSuiteName)
Definition: test_suite.h:29
The test case base class.
Definition: test_case.h:53
This class holds an array of test cases and run them one by one in its Run method.
Definition: test_suite.h:47
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: test_suite.cpp:82
TestSuite(TestSuite const &rOther)=delete
The TestSuite cannot be copied to avoid duplications.
TestSuite & operator=(TestSuite const &rOther)=delete
Preventing the assignment of the test suites.
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: test_suite.cpp:84
std::vector< TestCase * > TestCasesContainerType
Definition: test_suite.h:52
TestSuite()=delete
Default constructor is deleted becuase the Name should always passed to the constructor.
static void AddTestToTestSuite(std::string const &TestName, std::string const &TestSuiteName)
This method creates the suite if is no exist.
Definition: tester.cpp:180
std::istream & operator>>(std::istream &rIStream, TestSuite &rThis)
input stream function
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