Skip to content

Commit

Permalink
FIx: set FEATURE_TESTS in debug linux test presets
Browse files Browse the repository at this point in the history
Test presets not find the tests. enable_testing() is added when the FEATURE_TESTS is set.  After that,  when the test preset is run, the tests are found and run correctly.
  • Loading branch information
nejcgalof committed Aug 17, 2022
1 parent 39851c3 commit 940f300
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ if(FEATURE_TESTS)
set(ENABLE_CLANG_TIDY "ENABLE_CLANG_TIDY")
set(ENABLE_CPPCHECK "ENABLE_CPPCHECK")
set(ENABLE_COVERAGE "ENABLE_COVERAGE")
enable_testing()

if(NOT
"${CMAKE_SYSTEM_NAME}"
Expand Down
14 changes: 8 additions & 6 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"CMAKE_CXX_COMPILER": "cl",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"ENABLE_DEVELOPER_MODE": "ON"
}
}
},
{
"name": "windows-msvc-debug-user-mode",
Expand All @@ -87,7 +87,7 @@
"CMAKE_CXX_COMPILER": "cl",
"CMAKE_BUILD_TYPE": "Debug",
"ENABLE_DEVELOPER_MODE": "OFF"
}
}
},
{
"name": "windows-msvc-release-user-mode",
Expand All @@ -99,7 +99,7 @@
"CMAKE_CXX_COMPILER": "cl",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"ENABLE_DEVELOPER_MODE": "OFF"
}
}
},
{
"name": "windows-clang-debug",
Expand Down Expand Up @@ -141,7 +141,8 @@
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_BUILD_TYPE": "Debug"
"CMAKE_BUILD_TYPE": "Debug",
"FEATURE_TESTS": true
}
},
{
Expand All @@ -163,7 +164,8 @@
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_BUILD_TYPE": "Debug"
"CMAKE_BUILD_TYPE": "Debug",
"FEATURE_TESTS": true
}
},
{
Expand Down Expand Up @@ -248,4 +250,4 @@
"configurePreset": "linux-clang-release"
}
]
}
}

0 comments on commit 940f300

Please sign in to comment.