Skip to content

Commit 69fb048

Browse files
committed
Move test environment sources to a separate folder.
1 parent d85221f commit 69fb048

19 files changed

+44
-33
lines changed

CMakeLists.txt

+12-1
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ install (FILES ${LocalizationFiles} DESTINATION localization)
9999
# NodeEngineTest
100100

101101
set (TestFrameworkSourcesFolder Sources/TestFramework)
102+
set (TestEnvironmentSourcesFolder Sources/NodeEngineTest/TestEnvironment)
102103
set (NodeEngineTestSourcesFolder Sources/NodeEngineTest)
103104
file (GLOB TestFrameworkFiles ${TestFrameworkSourcesFolder}/*.hpp ${TestFrameworkSourcesFolder}/*.cpp)
105+
file (GLOB TestEnvironmentFiles ${TestEnvironmentSourcesFolder}/*.hpp ${TestEnvironmentSourcesFolder}/*.cpp)
104106
file (GLOB NodeEngineTestHeaderFiles ${NodeEngineTestSourcesFolder}/*.hpp)
105107
file (GLOB NodeEngineTestSourceFiles ${NodeEngineTestSourcesFolder}/*.cpp)
106108
set (
@@ -111,13 +113,22 @@ set (
111113
set (
112114
NodeEngineTestFiles
113115
${TestFrameworkFiles}
116+
${TestEnvironmentFiles}
114117
${NodeEngineTestTestFiles}
115118
)
116119
source_group ("Framework" FILES ${TestFrameworkFiles})
120+
source_group ("Environment" FILES ${TestEnvironmentFiles})
117121
source_group ("Sources" FILES ${NodeEngineTestTestFiles})
118122
add_executable (NodeEngineTest ${NodeEngineTestFiles})
119123
set_target_properties (NodeEngineTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
120-
target_include_directories (NodeEngineTest PUBLIC ${NodeEngineSourcesFolder} ${NodeUIEngineSourcesFolder} ${BuiltInNodesSourcesFolder} ${TestFrameworkSourcesFolder})
124+
target_include_directories (
125+
NodeEngineTest PUBLIC
126+
${NodeEngineSourcesFolder}
127+
${NodeUIEngineSourcesFolder}
128+
${BuiltInNodesSourcesFolder}
129+
${TestFrameworkSourcesFolder}
130+
${TestEnvironmentSourcesFolder}
131+
)
121132
target_link_libraries (NodeEngineTest NodeEngine NodeUIEngine BuiltInNodes)
122133
get_filename_component (NodeEngineTestSourcesFolderAbsolute "${CMAKE_CURRENT_LIST_DIR}/${NodeEngineTestSourcesFolder}" ABSOLUTE)
123134
add_custom_command (TARGET NodeEngineTest POST_BUILD

Sources/NodeEngineTest/CompatibitilityTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "BI_InputUINodes.hpp"
55
#include "BI_BinaryOperationNodes.hpp"
66
#include "BI_ViewerUINodes.hpp"
7-
#include "VisualTestFramework.hpp"
7+
#include "TestEnvironment.hpp"
88
#include "TestReference.hpp"
99

1010
#include <fstream>

Sources/NodeEngineTest/NodeEditorTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "NE_MemoryStream.hpp"
33
#include "NUIE_NodeEditor.hpp"
44
#include "BI_BuiltInNodes.hpp"
5-
#include "VisualTestFramework.hpp"
5+
#include "TestEnvironment.hpp"
66

77
using namespace NE;
88
using namespace NUIE;

Sources/NodeEngineTest/NodeEditorVisualTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "NUIE_FeatureToggle.hpp"
55
#include "BI_InputUINodes.hpp"
66
#include "BI_ViewerUINodes.hpp"
7-
#include "VisualTestFramework.hpp"
7+
#include "TestEnvironment.hpp"
88

99
using namespace NE;
1010
using namespace NUIE;

Sources/NodeEngineTest/NodeEditorVisualTestConnection.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "NUIE_NodeEditor.hpp"
33
#include "BI_InputUINodes.hpp"
44
#include "BI_ViewerUINodes.hpp"
5-
#include "VisualTestFramework.hpp"
5+
#include "TestEnvironment.hpp"
66

77
using namespace NE;
88
using namespace NUIE;

Sources/NodeEngineTest/NodeEditorVisualTestGrouping.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "NUIE_NodeEditor.hpp"
33
#include "BI_InputUINodes.hpp"
44
#include "BI_ViewerUINodes.hpp"
5-
#include "VisualTestFramework.hpp"
5+
#include "TestEnvironment.hpp"
66

77
using namespace NE;
88
using namespace NUIE;

Sources/NodeEngineTest/NodeEditorVisualTestNavigation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "NUIE_NodeEditor.hpp"
33
#include "BI_InputUINodes.hpp"
44
#include "BI_ViewerUINodes.hpp"
5-
#include "VisualTestFramework.hpp"
5+
#include "TestEnvironment.hpp"
66

77
using namespace NE;
88
using namespace NUIE;

Sources/NodeEngineTest/NodeEditorVisualTestRecalculation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "NUIE_NodeEditor.hpp"
33
#include "BI_InputUINodes.hpp"
44
#include "BI_ViewerUINodes.hpp"
5-
#include "VisualTestFramework.hpp"
5+
#include "TestEnvironment.hpp"
66

77
using namespace NE;
88
using namespace NUIE;

Sources/NodeEngineTest/NodeEditorVisualTestSlotMarkers.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "NUIE_FeatureToggle.hpp"
55
#include "BI_InputUINodes.hpp"
66
#include "BI_ViewerUINodes.hpp"
7-
#include "VisualTestFramework.hpp"
7+
#include "TestEnvironment.hpp"
88

99
using namespace NE;
1010
using namespace NUIE;

Sources/NodeEngineTest/NodeEditorVisualTestWorkflow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "NUIE_NodeEditor.hpp"
33
#include "BI_BuiltInNodes.hpp"
44
#include "BI_ViewerUINodes.hpp"
5-
#include "VisualTestFramework.hpp"
5+
#include "TestEnvironment.hpp"
66

77
using namespace NE;
88
using namespace NUIE;

Sources/NodeEngineTest/VisualTestFramework.cpp Sources/NodeEngineTest/TestEnvironment/TestEnvironment.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "VisualTestFramework.hpp"
1+
#include "TestEnvironment.hpp"
22
#include "NUIE_FileIO.hpp"
33
#include "NUIE_InputEventHandler.hpp"
44
#include "BI_BuiltInNodes.hpp"

Sources/NodeEngineTest/VisualTestFramework.hpp Sources/NodeEngineTest/TestEnvironment/TestEnvironment.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef VISUALTESTFRAMEWORK_HPP
2-
#define VISUALTESTFRAMEWORK_HPP
1+
#ifndef TESTENVIRONMENT_HPP
2+
#define TESTENVIRONMENT_HPP
33

44
#include "NE_StringConverter.hpp"
55
#include "NE_EvaluationEnv.hpp"

Sources/TestFramework/SimpleTest.hpp

+20-20
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,6 @@
99
#define WIN_PATH_SEPARATOR L'\\'
1010
#define PATH_SEPARATOR L'/'
1111

12-
#define TEST(TESTNAME) \
13-
class TESTNAME##_Test : public SimpleTest::Test { \
14-
public: \
15-
TESTNAME##_Test () : \
16-
SimpleTest::Test (#TESTNAME) \
17-
{ \
18-
} \
19-
virtual void RunTest () override; \
20-
}; \
21-
static class TESTNAME##_Registrator { \
22-
public: \
23-
TESTNAME##_Registrator () \
24-
{ \
25-
SimpleTest::RegisterTest (new TESTNAME##_Test ()); \
26-
} \
27-
} TESTNAME##_RegistratorInstance; \
28-
void TESTNAME##_Test::RunTest ()
29-
30-
#define ASSERT(condition) TestAssert (condition, __FILE__, __LINE__)
31-
3212
namespace SimpleTest
3313
{
3414

@@ -72,4 +52,24 @@ void RegisterTest (Test* test);
7252

7353
}
7454

55+
#define TEST(TESTNAME) \
56+
class TESTNAME##_Test : public SimpleTest::Test { \
57+
public: \
58+
TESTNAME##_Test () : \
59+
SimpleTest::Test (#TESTNAME) \
60+
{ \
61+
} \
62+
virtual void RunTest () override; \
63+
}; \
64+
static class TESTNAME##_Registrator { \
65+
public: \
66+
TESTNAME##_Registrator () \
67+
{ \
68+
SimpleTest::RegisterTest (new TESTNAME##_Test ()); \
69+
} \
70+
} TESTNAME##_RegistratorInstance; \
71+
void TESTNAME##_Test::RunTest ()
72+
73+
#define ASSERT(condition) TestAssert (condition, __FILE__, __LINE__)
74+
7575
#endif

0 commit comments

Comments
 (0)