Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey,
CTest discovery for windows is broken as the backslashes are not escaped. On the current master and Windows you get:
[build] CMake Error at C:/development/.../UnitTest/build/_deps/cpputest-src/cmake/Modules/_CppUTestDiscovery.cmake:34 (add_command): [build] Syntax error in cmake code at [build] [build] C:/development/.../UnitTest/build/_deps/cpputest-src/cmake/Modules/_CppUTestDiscovery.cmake:39 [build] [build] when parsing string [build] [build] C:\development\...\UnitTest\Test\test_UnitUnderTest.cpp:55 [build] [build] Invalid character escape '\d'. [build] Call Stack (most recent call first): [build] C:/development/.../UnitTest/build/_deps/cpputest-src/cmake/Modules/_CppUTestDiscovery.cmake:93 (add_test_to_script) [build]
Tested on Win11 cmake/4.0.1 mingw-builds/14.2.0
Suggested fix, let CMake handle path quirks:
diff --git a/cmake/Modules/_CppUTestDiscovery.cmake b/cmake/Modules/_CppUTestDiscovery.cmake index 2b36a73e..a7faae98 100644 --- a/cmake/Modules/_CppUTestDiscovery.cmake +++ b/cmake/Modules/_CppUTestDiscovery.cmake @@ -68,14 +68,14 @@ if(TESTS_DETAILED) foreach(line IN LISTS discovered_test_lines) string(REGEX MATCH "${LL_LINE_REGEX}" __unused "${line}") set(test_name "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}") - set(test_location "${CMAKE_MATCH_3}:${CMAKE_MATCH_4}") + cmake_path(SET test_location "${CMAKE_MATCH_3}:${CMAKE_MATCH_4}") add_test_to_script("${test_name}" "${test_location}" -st) endforeach() else() foreach(line IN LISTS discovered_test_lines) string(REGEX MATCH "${LL_LINE_REGEX}" __unused "${line}") set(test_name "${CMAKE_MATCH_1}") - set(test_file "${CMAKE_MATCH_3}") + cmake_path(SET test_file "${CMAKE_MATCH_3}") set(test_line "${CMAKE_MATCH_4}") if (NOT _${test_name}_file) # if the group spans two files, arbitrarily choose the first one encountered
The text was updated successfully, but these errors were encountered:
cmake_path requires cmake 3.20+ which is a significant jump from our current minimum of 3.8. I'll have to think about this.
cmake_path
Sorry, something went wrong.
I'm also concerned that this isn't failing the build.
Successfully merging a pull request may close this issue.
Hey,
CTest discovery for windows is broken as the backslashes are not escaped. On the current master and Windows you get:
Tested on
Win11
cmake/4.0.1
mingw-builds/14.2.0
Suggested fix, let CMake handle path quirks:
The text was updated successfully, but these errors were encountered: