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
Describe the bug
I started to write a simple test for my project, below of my top-level project. On the bottom of this top-level CmakeLists.txt, I do:
CmakeLists.txt
make_minimum_required(VERSION 3.28) project(cool_app) ... # Unit tests add_subdirectory(test)
The test sub-dir contains the CMakeLists.txt:
cmake_minimum_required(VERSION 3.28) set(PROJECT_UNIT_TESTS_NAME ${CMAKE_PROJECT_NAME}_unit_tests) project(${PROJECT_UNIT_TESTS_NAME} LANGUAGES CXX VERSION 0.0.1) find_package(Catch2 3 REQUIRED) include(CTest) include(Catch) add_executable(${PROJECT_UNIT_TESTS_NAME} test1.cpp) target_link_libraries(${PROJECT_UNIT_TESTS_NAME} PRIVATE Catch2::Catch2WithMain) enable_testing() catch_discover_tests(${PROJECT_UNIT_TESTS_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/build )
After successfully build I want to run it:
$ ctest --test-dir ./build Internal ctest changing into directory: /home/${USERNAME}/work/my_project/build Test project /home/${USERNAME}/work/my_project/build No tests were found!!! $ ls -la build/test/cool_app_unit_tests -rwxrwxr-x 1 ${USERNAME} ${USERNAME} 1133056 Sep 27 20:10 build/test/cool_app_unit_tests*
So, it exist but isn't found finally.
Expected behavior
running the test
Platform information:
Additional context
I've checked the docs and Stackoverflow without success.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
I started to write a simple test for my project, below of my top-level project. On the bottom of this top-level
CmakeLists.txt
, I do:The test sub-dir contains the CMakeLists.txt:
After successfully build I want to run it:
So, it exist but isn't found finally.
Expected behavior
running the test
Platform information:
Additional context
I've checked the docs and Stackoverflow without success.
The text was updated successfully, but these errors were encountered: