Skip to content

Commit dbe0cbf

Browse files
committed
add test & workflow presets
1 parent 68662b7 commit dbe0cbf

File tree

2 files changed

+96
-12
lines changed

2 files changed

+96
-12
lines changed

CMakePresets.json

Lines changed: 95 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"value": "x64",
3434
"strategy": "external"
3535
},
36-
"toolset":{
36+
"toolset": {
3737
"value": "host=x64",
3838
"strategy": "external"
3939
}
@@ -122,35 +122,59 @@
122122
},
123123
{
124124
"name": "Windows-msvc-Debug",
125-
"inherits": ["confs-windows-msvc-common", "debug"]
125+
"inherits": [
126+
"confs-windows-msvc-common",
127+
"debug"
128+
]
126129
},
127130
{
128131
"name": "Windows-msvc-Release",
129-
"inherits": ["confs-windows-msvc-common", "release"]
132+
"inherits": [
133+
"confs-windows-msvc-common",
134+
"release"
135+
]
130136
},
131137
{
132138
"name": "Windows-llvm-Debug",
133-
"inherits": ["confs-windows-llvm-common", "debug"]
139+
"inherits": [
140+
"confs-windows-llvm-common",
141+
"debug"
142+
]
134143
},
135144
{
136145
"name": "Windows-llvm-Release",
137-
"inherits": ["confs-windows-llvm-common", "release"]
146+
"inherits": [
147+
"confs-windows-llvm-common",
148+
"release"
149+
]
138150
},
139151
{
140152
"name": "llvm-Debug",
141-
"inherits": ["confs-linux-llvm-common", "debug"]
153+
"inherits": [
154+
"confs-linux-llvm-common",
155+
"debug"
156+
]
142157
},
143158
{
144159
"name": "llvm-Release",
145-
"inherits": ["confs-linux-llvm-common", "release"]
160+
"inherits": [
161+
"confs-linux-llvm-common",
162+
"release"
163+
]
146164
},
147165
{
148166
"name": "gcc-Debug",
149-
"inherits": ["confs-linux-gcc-common", "debug"]
167+
"inherits": [
168+
"confs-linux-gcc-common",
169+
"debug"
170+
]
150171
},
151172
{
152173
"name": "gcc-Release",
153-
"inherits": ["confs-linux-gcc-common", "release"]
174+
"inherits": [
175+
"confs-linux-gcc-common",
176+
"release"
177+
]
154178
}
155179
],
156180
"buildPresets": [
@@ -186,5 +210,67 @@
186210
"name": "gcc-Release",
187211
"configurePreset": "gcc-Release"
188212
}
213+
],
214+
"testPresets": [
215+
{
216+
"name": "test-Windows-msvc-Debug",
217+
"description": "Enable output and stop on failure",
218+
"output": {
219+
"outputOnFailure": true
220+
},
221+
"execution": {
222+
"noTestsAction": "error",
223+
"stopOnFailure": true
224+
},
225+
"configurePreset": "Windows-msvc-Debug"
226+
},
227+
{
228+
"name": "test-Windows-llvm-Debug",
229+
"description": "Enable output and stop on failure",
230+
"output": {
231+
"outputOnFailure": true
232+
},
233+
"execution": {
234+
"noTestsAction": "error",
235+
"stopOnFailure": true
236+
},
237+
"configurePreset": "Windows-llvm-Debug"
238+
}
239+
],
240+
"workflowPresets": [
241+
{
242+
"name": "Windows-msvc-Debug",
243+
"steps": [
244+
{
245+
"type": "configure",
246+
"name": "Windows-msvc-Debug"
247+
},
248+
{
249+
"type": "build",
250+
"name": "Windows-msvc-Debug"
251+
},
252+
{
253+
"type": "test",
254+
"name": "test-Windows-msvc-Debug"
255+
}
256+
]
257+
},
258+
{
259+
"name": "Windows-llvm-Debug",
260+
"steps": [
261+
{
262+
"type": "configure",
263+
"name": "Windows-llvm-Debug"
264+
},
265+
{
266+
"type": "build",
267+
"name": "Windows-llvm-Debug"
268+
},
269+
{
270+
"type": "test",
271+
"name": "test-Windows-llvm-Debug"
272+
}
273+
]
274+
}
189275
]
190276
}

library/test/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
include(CTest)
2-
31
find_package(Catch2 REQUIRED)
42
include(Catch)
53

64
add_executable(CoreTests ${PROJECT_SOURCE_DIR}/library/test/Tests.cpp)
7-
85
target_link_libraries(CoreTests PRIVATE Core Catch2::Catch2WithMain)
96
target_compile_features(CoreTests PRIVATE cxx_std_17)
7+
set_target_properties(CoreTests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PROJECT_NAME}/Tests)
108
catch_discover_tests(CoreTests)

0 commit comments

Comments
 (0)