OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
RuntimeTests.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
12
13// std header
14#include <string>
15#include <chrono>
16
17#if OT_TESTING_GLOBAL_AllTestsEnabled==true
18#define OT_TEST_Interval_Enabled OT_TESTING_GLOBAL_AllTestsEnabled
19#else
20#define OT_TEST_Interval_Enabled true
21#endif
22
23#if OT_TESTING_GLOBAL_RuntimeTestingEnabled==true && OT_TEST_Interval_Enabled==true
27#define OT_TEST_Interval(___objectName, ___testCategory, ___testText) ot::RuntimeIntervalTest ___objectName; ___objectName.logOnDelete("[" ___testCategory "] " ___testText)
28#else
29#define OT_TEST_Interval(___objectName, ___testCategory, ___testText)
30#endif
31
32#pragma warning(disable:4251)
33
34namespace ot {
35
38 public:
41
43 void logCurrentInterval(const std::string& _testName) const;
44
46 long long currentInterval(void) const;
47
48 void logOnDelete(const std::string& _message);
49
50 private:
51 std::string niceIntervalString(long long _ms) const;
52
53 bool m_logOnDeleteEnabled;
54 std::string m_logOnDelete;
55 std::chrono::steady_clock::time_point m_startTime;
56 };
57
58}
#define OT_CORE_API_EXPORT
Dll import.
Definition CoreAPIExport.h:8
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
Definition RuntimeTests.h:36
Definition Connector.h:8