15 #ifndef INCG_IRIS_IUTEST_CORE_IMPL_HPP_D5ABC7DE_C751_4AC0_922F_547880163891_
16 #define INCG_IRIS_IUTEST_CORE_IMPL_HPP_D5ABC7DE_C751_4AC0_922F_547880163891_
22 #include "../iutest_case.hpp"
33 #if IUTEST_USE_OWN_LIST
34 typedef detail::iu_list<TestCase> iuTestCases;
36 typedef ::std::vector<TestCase*> iuTestCases;
38 typedef ::std::vector<Environment*> iuEnvironmentList;
40 UnitTestImpl() : m_total_test_num(0), m_disable_num(0), m_should_run_num(0)
41 , m_current_testcase(NULL), m_elapsedmsec(0)
45 ~UnitTestImpl() { TerminateImpl(); }
51 static TestResult* current_test_result();
60 static bool ValidateTestPropertyName(const ::std::string& name)
63 "name",
"tests",
"failures",
"disabled",
"skip",
"errors",
"time",
"timestamp",
"random_seed"
65 #if !defined(IUTEST_NO_FUNCTION_TEMPLATE_ORDERING)
75 TestCase* AddTestCase(const ::std::string& testcase_name,
TestTypeId id
81 p =
new T (testcase_name,
id, setup, teardown);
82 m_testcases.push_back(p);
87 void AddTestInfo(TestCase* pCase, TestInfo* pInfo);
89 static bool SkipTest();
100 int ListupWithWhere()
const;
110 void ClearNonAdHocTestResult();
115 void ClearAdHocTestResult()
117 m_ad_hoc_testresult.Clear();
124 static void RecordProperty(
const TestProperty& prop);
134 bool DoInfoOptions();
140 void InitializeImpl();
144 void TerminateImpl();
147 #if IUTEST_HAS_INVALID_PARAMETER_HANDLER
149 IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_BEGIN()
152 static
void OnInvalidParameter(const
wchar_t * expression, const
wchar_t * function
153 , const
wchar_t * file,
unsigned int line, uintptr_t pReserved);
155 IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_END()
162 static UnitTestImpl* ptr = NULL;
166 friend class UnitTestSource;
167 friend class Test::TestRecordPropertyHelper;
169 int m_total_test_num;
171 int m_should_run_num;
172 TestCase* m_current_testcase;
174 iuTestCases m_testcases;
175 TestResult m_ad_hoc_testresult;
185 ::std::string MakeIndexName(
size_t index);
192 ::std::string MakeIndexTestName(
const char* basename,
size_t index);
199 ::std::string MakeParamTestName(const ::std::string& basename, const ::std::string& parame_name);
207 ::std::string MakeIndexTypedTestName(
const char* basename,
size_t index)
210 ::std::string name = MakeIndexTestName(basename, index);
212 name += GetTypeNameProxy<T>::GetTypeNameProxy();
215 return MakeIndexTestName(basename, index);
225 ::std::string MakePrefixedIndexTestName(
const char* prefix,
const char* basename,
size_t index);
234 ::std::string MakePrefixedIndexTypedTestName(
const char* prefix,
const char* basename,
size_t index)
237 ::std::string name = prefix;
242 name += MakeIndexTypedTestName<T>(basename, index);
245 return MakePrefixedIndexTestName(prefix, basename, index);
254 # include "../impl/iutest_core_impl.ipp"
257 #endif // INCG_IRIS_IUTEST_CORE_IMPL_HPP_D5ABC7DE_C751_4AC0_922F_547880163891_