-
Notifications
You must be signed in to change notification settings - Fork 26
/
CMakeLists.txt
318 lines (296 loc) · 15.2 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
cmake_minimum_required(VERSION 2.6)
project(tcframe)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 --coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
find_package(Git REQUIRED)
find_package(Threads REQUIRED)
include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.8.0
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/googletest
CMAKE_ARGS ${CMAKE_ARGS} -DBUILD_GTEST=ON -DBUILD_GMOCK=ON -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(googletest source_dir binary_dir)
add_library(gtest IMPORTED STATIC GLOBAL)
add_library(gmock IMPORTED STATIC GLOBAL)
set_target_properties(
gtest PROPERTIES
"IMPORTED_LOCATION" "${binary_dir}/googlemock/gtest/libgtest.a"
"IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}"
)
set_target_properties(
gmock PROPERTIES
"IMPORTED_LOCATION" "${binary_dir}/googlemock/libgmock_main.a"
"IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}"
)
add_dependencies(gtest googletest)
add_dependencies(gmock googletest)
include_directories("${source_dir}/googletest/include")
include_directories("${source_dir}/googlemock/include")
include_directories(include)
set(INCLUDE
include/tcframe/driver.hpp
include/tcframe/driver/Driver.hpp
include/tcframe/driver/RawIOManipulator.hpp
include/tcframe/driver/SlugParser.hpp
include/tcframe/driver/SpecDriver.hpp
include/tcframe/driver/TestCaseDriver.hpp
include/tcframe/exception.hpp
include/tcframe/exception/FormattedError.hpp
include/tcframe/exception/NotImplementedException.hpp
include/tcframe/runner.hpp
include/tcframe/runner/aggregator.hpp
include/tcframe/runner/aggregator/AggregatorRegistry.hpp
include/tcframe/runner/aggregator/MinAggregator.hpp
include/tcframe/runner/aggregator/SubtaskAggregator.hpp
include/tcframe/runner/aggregator/SumAggregator.hpp
include/tcframe/runner/aggregator/TestCaseAggregator.hpp
include/tcframe/runner/client.hpp
include/tcframe/runner/client/SpecClient.hpp
include/tcframe/runner/core.hpp
include/tcframe/runner/core/Args.hpp
include/tcframe/runner/core/ArgsParser.hpp
include/tcframe/runner/core/Runner.hpp
include/tcframe/runner/evaluator.hpp
include/tcframe/runner/evaluator/BatchEvaluator.hpp
include/tcframe/runner/evaluator/EvaluationOptions.hpp
include/tcframe/runner/evaluator/EvaluationResult.hpp
include/tcframe/runner/evaluator/Evaluator.hpp
include/tcframe/runner/evaluator/EvaluatorConfig.hpp
include/tcframe/runner/evaluator/EvaluatorHelperRegistry.hpp
include/tcframe/runner/evaluator/EvaluatorRegistry.hpp
include/tcframe/runner/evaluator/InteractiveEvaluator.hpp
include/tcframe/runner/evaluator/GenerationResult.hpp
include/tcframe/runner/evaluator/communicator.hpp
include/tcframe/runner/evaluator/communicator/CommunicationResult.hpp
include/tcframe/runner/evaluator/communicator/Communicator.hpp
include/tcframe/runner/evaluator/scorer.hpp
include/tcframe/runner/evaluator/scorer/CustomScorer.hpp
include/tcframe/runner/evaluator/scorer/DiffScorer.hpp
include/tcframe/runner/evaluator/scorer/Scorer.hpp
include/tcframe/runner/evaluator/scorer/ScoringResult.hpp
include/tcframe/runner/grader.hpp
include/tcframe/runner/grader/BriefGraderLogger.hpp
include/tcframe/runner/grader/DefaultGraderLogger.hpp
include/tcframe/runner/grader/Grader.hpp
include/tcframe/runner/grader/GraderLogger.hpp
include/tcframe/runner/grader/GraderLoggerFactory.hpp
include/tcframe/runner/grader/GradingOptions.hpp
include/tcframe/runner/grader/TestCaseGrader.hpp
include/tcframe/runner/generator.hpp
include/tcframe/runner/generator/DefaultGeneratorLogger.hpp
include/tcframe/runner/generator/GenerationOptions.hpp
include/tcframe/runner/generator/Generator.hpp
include/tcframe/runner/generator/GeneratorLogger.hpp
include/tcframe/runner/generator/TestCaseGenerator.hpp
include/tcframe/runner/logger.hpp
include/tcframe/runner/logger/BaseLogger.hpp
include/tcframe/runner/logger/DefaultBaseLogger.hpp
include/tcframe/runner/logger/LoggerEngine.hpp
include/tcframe/runner/logger/RunnerLogger.hpp
include/tcframe/runner/logger/SimpleLoggerEngine.hpp
include/tcframe/runner/os.hpp
include/tcframe/runner/os/ExecutionResult.hpp
include/tcframe/runner/os/ExecutionRequest.hpp
include/tcframe/runner/os/OperatingSystem.hpp
include/tcframe/runner/os/TestCasePathCreator.hpp
include/tcframe/runner/verdict.hpp
include/tcframe/runner/verdict/SubtaskVerdict.hpp
include/tcframe/runner/verdict/TestCaseVerdict.hpp
include/tcframe/runner/verdict/TestCaseVerdictParser.hpp
include/tcframe/runner/verdict/Verdict.hpp
include/tcframe/spec.hpp
include/tcframe/spec/config.hpp
include/tcframe/spec/config/GradingConfig.hpp
include/tcframe/spec/config/MultipleTestCasesConfig.hpp
include/tcframe/spec/config/StyleConfig.hpp
include/tcframe/spec/constraint.hpp
include/tcframe/spec/constraint/Constraint.hpp
include/tcframe/spec/constraint/ConstraintSuite.hpp
include/tcframe/spec/constraint/Subtask.hpp
include/tcframe/spec/core.hpp
include/tcframe/spec/core/BaseTestSpec.hpp
include/tcframe/spec/core/BaseProblemSpec.hpp
include/tcframe/spec/core/Magic.hpp
include/tcframe/spec/core/SeedSetter.hpp
include/tcframe/spec/core/SpecYaml.hpp
include/tcframe/spec/io.hpp
include/tcframe/spec/io/GridIOSegment.hpp
include/tcframe/spec/io/GridIOSegmentManipulator.hpp
include/tcframe/spec/io/IOFormat.hpp
include/tcframe/spec/io/IOManipulator.hpp
include/tcframe/spec/io/IOSegment.hpp
include/tcframe/spec/io/LineIOSegment.hpp
include/tcframe/spec/io/LineIOSegmentManipulator.hpp
include/tcframe/spec/io/LinesIOSegment.hpp
include/tcframe/spec/io/LinesIOSegmentManipulator.hpp
include/tcframe/spec/io/RawLineIOSegment.hpp
include/tcframe/spec/io/RawLineIOSegmentManipulator.hpp
include/tcframe/spec/io/RawLinesIOSegment.hpp
include/tcframe/spec/io/RawLinesIOSegmentManipulator.hpp
include/tcframe/spec/random.hpp
include/tcframe/spec/random/Random.hpp
include/tcframe/spec/testcase.hpp
include/tcframe/spec/testcase/OfficialTestCaseData.hpp
include/tcframe/spec/testcase/SampleTestCaseData.hpp
include/tcframe/spec/testcase/TestCase.hpp
include/tcframe/spec/testcase/TestCaseData.hpp
include/tcframe/spec/testcase/TestGroup.hpp
include/tcframe/spec/testcase/TestSuite.hpp
include/tcframe/spec/variable.hpp
include/tcframe/spec/variable/Scalar.hpp
include/tcframe/spec/variable/Matrix.hpp
include/tcframe/spec/variable/TokenFormatter.hpp
include/tcframe/spec/variable/Variable.hpp
include/tcframe/spec/variable/Vector.hpp
include/tcframe/spec/variable/WhitespaceManipulator.hpp
include/tcframe/spec/verifier.hpp
include/tcframe/spec/verifier/ConstraintsVerificationResult.hpp
include/tcframe/spec/verifier/MultipleTestCasesConstraintsVerificationResult.hpp
include/tcframe/spec/verifier/Verifier.hpp
include/tcframe/util.hpp
include/tcframe/util/StringUtils.hpp
include/tcframe/util/optional.hpp
include/tcframe/validator/core.hpp
)
set(TEST_UNIT
test/unit/tcframe/driver/MockDriver.hpp
test/unit/tcframe/driver/MockRawIOManipulator.hpp
test/unit/tcframe/driver/MockSpecDriver.hpp
test/unit/tcframe/driver/MockTestCaseDriver.hpp
test/unit/tcframe/driver/SpecDriverTests.cpp
test/unit/tcframe/driver/SlugParserTests.cpp
test/unit/tcframe/driver/TestCaseDriverTests.cpp
test/unit/tcframe/exception/FormattedErrorTests.cpp
test/unit/tcframe/helper.hpp
test/unit/tcframe/mock.hpp
test/unit/tcframe/runner/aggregator/MinAggregatorTests.cpp
test/unit/tcframe/runner/aggregator/MockAggregatorRegistry.hpp
test/unit/tcframe/runner/aggregator/MockSubtaskAggregator.hpp
test/unit/tcframe/runner/aggregator/MockTestCaseAggregator.hpp
test/unit/tcframe/runner/aggregator/SubtaskAggregatorTests.cpp
test/unit/tcframe/runner/aggregator/SumAggregatorTests.cpp
test/unit/tcframe/runner/core/ArgsParserTests.cpp
test/unit/tcframe/runner/core/BatchRunnerTests.cpp
test/unit/tcframe/runner/core/BaseRunnerTests.hpp
test/unit/tcframe/runner/core/InteractiveRunnerTests.cpp
test/unit/tcframe/runner/core/RunnerTests.cpp
test/unit/tcframe/runner/client/MockSpecClient.hpp
test/unit/tcframe/runner/client/SpecClientTests.cpp
test/unit/tcframe/runner/evaluator/BatchEvaluatorTests.cpp
test/unit/tcframe/runner/evaluator/InteractiveEvaluatorTests.cpp
test/unit/tcframe/runner/evaluator/MockEvaluator.hpp
test/unit/tcframe/runner/evaluator/MockEvaluatorRegistry.hpp
test/unit/tcframe/runner/evaluator/communicator/CommunicatorTests.cpp
test/unit/tcframe/runner/evaluator/communicator/MockCommunicator.hpp
test/unit/tcframe/runner/evaluator/scorer/CustomScorerTests.cpp
test/unit/tcframe/runner/evaluator/scorer/MockScorer.hpp
test/unit/tcframe/runner/generator/DefaultGeneratorLoggerTests.cpp
test/unit/tcframe/runner/generator/GeneratorTests.cpp
test/unit/tcframe/runner/generator/MockGenerator.hpp
test/unit/tcframe/runner/generator/MockGeneratorLogger.hpp
test/unit/tcframe/runner/generator/MockTestCaseGenerator.hpp
test/unit/tcframe/runner/generator/TestCaseGeneratorTests.cpp
test/unit/tcframe/runner/grader/BriefGraderLoggerTests.cpp
test/unit/tcframe/runner/grader/DefaultGraderLoggerTests.cpp
test/unit/tcframe/runner/grader/GraderTests.cpp
test/unit/tcframe/runner/grader/MockGrader.hpp
test/unit/tcframe/runner/grader/MockGraderLogger.hpp
test/unit/tcframe/runner/grader/MockGraderLoggerFactory.hpp
test/unit/tcframe/runner/grader/MockTestCaseGrader.hpp
test/unit/tcframe/runner/grader/TestCaseGraderTests.cpp
test/unit/tcframe/runner/logger/DefaultBaseLogggerTests.cpp
test/unit/tcframe/runner/logger/MockRunnerLogger.hpp
test/unit/tcframe/runner/logger/MockLoggerEngine.hpp
test/unit/tcframe/runner/logger/RunnerLoggerTests.cpp
test/unit/tcframe/runner/logger/SimpleLoggerEngineTests.cpp
test/unit/tcframe/runner/os/ExecutionResultTests.cpp
test/unit/tcframe/runner/os/MockOperatingSystem.hpp
test/unit/tcframe/runner/os/TestCasePathCreatorTests.cpp
test/unit/tcframe/runner/verdict/MockTestCaseVerdictParser.hpp
test/unit/tcframe/runner/verdict/SubtaskVerdictTests.cpp
test/unit/tcframe/runner/verdict/TestCaseVerdictParserTests.cpp
test/unit/tcframe/runner/verdict/TestCaseVerdictTests.cpp
test/unit/tcframe/spec/constraint/ConstraintSuiteTests.cpp
test/unit/tcframe/spec/constraint/ConstraintSuiteBuilderTests.cpp
test/unit/tcframe/spec/core/BaseTestSpecTests.cpp
test/unit/tcframe/spec/core/BaseProblemSpecTests.cpp
test/unit/tcframe/spec/core/MagicTests.cpp
test/unit/tcframe/spec/core/MockSeedSetter.hpp
test/unit/tcframe/spec/io/GridIOSegmentBuilderTests.cpp
test/unit/tcframe/spec/io/GridIOSegmentManipulatorTests.cpp
test/unit/tcframe/spec/io/IOFormatBuilderTests.cpp
test/unit/tcframe/spec/io/IOManipulatorTests.cpp
test/unit/tcframe/spec/io/LineIOSegmentBuilderTests.cpp
test/unit/tcframe/spec/io/LineIOSegmentManipulatorTests.cpp
test/unit/tcframe/spec/io/LinesIOSegmentBuilderTests.cpp
test/unit/tcframe/spec/io/LinesIOSegmentManipulatorTests.cpp
test/unit/tcframe/spec/io/MockIOManipulator.hpp
test/unit/tcframe/spec/io/RawLineIOSegmentBuilderTests.cpp
test/unit/tcframe/spec/io/RawLineIOSegmentManipulatorTests.cpp
test/unit/tcframe/spec/io/RawLinesIOSegmentBuilderTests.cpp
test/unit/tcframe/spec/io/RawLinesIOSegmentManipulatorTests.cpp
test/unit/tcframe/spec/random/RandomTests.cpp
test/unit/tcframe/spec/testcase/TestCaseTests.cpp
test/unit/tcframe/spec/testcase/TestGroupTests.cpp
test/unit/tcframe/spec/testcase/TestSuiteBuilderTests.cpp
test/unit/tcframe/spec/variable/MatrixTests.cpp
test/unit/tcframe/spec/variable/ScalarTests.cpp
test/unit/tcframe/spec/variable/TokenFormatterTests.cpp
test/unit/tcframe/spec/variable/VariableTests.cpp
test/unit/tcframe/spec/variable/VectorTests.cpp
test/unit/tcframe/spec/variable/WhitespaceManipulatorTests.cpp
test/unit/tcframe/spec/verifier/MockVerifier.hpp
test/unit/tcframe/spec/verifier/VerifierTests.cpp
test/unit/tcframe/util/OptionalTests.cpp
test/unit/tcframe/util/StringUtilsTests.cpp
test/unit/tcframe/util/TestUtils.hpp
test/unit/tcframe/validator/CoreValidatorTests.cpp
)
add_executable(test_unit ${INCLUDE} ${TEST_UNIT})
target_link_libraries(test_unit
gtest
gmock
${CMAKE_THREAD_LIBS_INIT}
gcov
)
set(TEST_INTEGRATION
test/integration/tcframe/runner/evaluator/communicator/CommunicatorIntegrationTests.cpp
test/integration/tcframe/runner/evaluator/scorer/CustomScorerIntegrationTests.cpp
test/integration/tcframe/runner/evaluator/scorer/DiffScorerIntegrationTests.cpp
test/integration/tcframe/runner/os/OperatingSystemIntegrationTests.cpp
)
add_executable(test_integration ${INCLUDE} ${TEST_INTEGRATION})
target_link_libraries(test_integration
gtest
gmock
${CMAKE_THREAD_LIBS_INIT}
gcov
)
add_custom_command(
TARGET test_integration
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/test/integration/resources $<TARGET_FILE_DIR:test_integration>/test-integration
)
set(TEST_ETE
test/ete/tcframe/BaseEteTests.cpp
test/ete/tcframe/GenerationEteTests.cpp
test/ete/tcframe/GradingEteTests.cpp
)
add_executable(test_ete ${TEST_ETE})
target_link_libraries(test_ete
gtest
gmock
${CMAKE_THREAD_LIBS_INIT}
gcov
)
add_custom_command(
TARGET test_ete
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/include $<TARGET_FILE_DIR:test_ete>/tcframe/include
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/src $<TARGET_FILE_DIR:test_ete>/tcframe/src
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/scripts $<TARGET_FILE_DIR:test_ete>/tcframe/scripts
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/test/ete/resources $<TARGET_FILE_DIR:test_ete>/test-ete
)