8000 Eliminate double-negative in option name / value · unittest-cpp/unittest-cpp@4d7ae2e · GitHub
[go: up one dir, main page]

Skip to content

Commit 4d7ae2e

Browse files
committed
Eliminate double-negative in option name / value
UTPP_SKIP_TESTS_AS_BUILD_STEP with a default value of OFF was an unfortunate choice, so this changes it to UTPP_RUN_TESTS_AS_BUILD_STEP with a default value of ON.
1 parent f70de50 commit 4d7ae2e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ project(UnitTest++)
44
option(UTPP_USE_PLUS_SIGN
55
"Set this to OFF if you wish to use '-cpp' instead of '++' in lib/include paths"
66
ON)
7-
option(UTPP_SKIP_TESTS_AS_BUILD_STEP
8-
"Set this to ON if you do not wish unit tests to run as part of cmake --build"
9-
OFF)
7+
option(UTPP_RUN_TESTS_AS_BUILD_STEP
8+
"Set this to OFF if you do not wish unit tests to run as part of cmake --build"
9+
ON)
1010

1111
if(MSVC14 OR MSVC12)
1212
# has the support we need
@@ -60,14 +60,14 @@ endif()
6060

6161
target_link_libraries(TestUnitTest++ UnitTest++)
6262

63-
if(${UTPP_SKIP_TESTS_AS_BUILD_STEP})
63+
if(${UTPP_RUN_TESTS_AS_BUILD_STEP})
64+
# run unit tests as post build step
6465
add_custom_command(TARGET TestUnitTest++
65-
POST_BUILD COMMAND echo "TestUnitTest++ was not run as a build step because UTPP_SKIP_TESTS_AS_BUILD_STEP is ON")
66+
POST_BUILD COMMAND TestUnitTest++
67+
COMMENT "Running unit tests")
6668
else()
67-
# run unit tests as post build step
6869
add_custom_command(TARGET TestUnitTest++
69-
POST_BUILD COMMAND TestUnitTest++
70-
COMMENT "Running unit tests")
70+
POST_BUILD COMMAND echo "TestUnitTest++ was not run as a build step because UTPP_RUN_TESTS_AS_BUILD_STEP is OFF")
7171
endif()
7272

7373
# add install targets

0 commit comments

Comments
 (0)
0