Adds target to CTest
See original GitHub issuehi,
I added a simple executable to ctest on my project.
On the terminal I run ctest and it works perfectly.
but When I click on the Run CTest button on the bottom status bar it runs ctest -j4 -C Debug -T test --output-on-failure.
I adds -T test that is making my test to not run as expected.
It also added a lot of new targets to the target list.
root CMakeLists.txt:
...
add_executable(${TESTS_TARGET_NAME})
if (BUILD_TESTING)
include(CTest)
enable_testing()
add_subdirectory (tests)
add_test (NAME Tests
COMMAND
${TESTS_TARGET_NAME}
WORKING_DIRECTORY
${CMAKE_INSTALL_PREFIX}/bin
)
endif ()
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to add a CMake custom target to test all sub-projects?
In projects A and B I have tests that I add using add_test . When inside a project I can do make test...
Read more >add_test — CMake 3.25.1 Documentation
Add a test to the project to be run by ctest(1) . ... Specify the test command-line. If <command> specifies an executable target...
Read more >Creating and running tests with CTest — CMake Workshop
In CMake and CTest, a test is any command returning an exit code. ... This takes no arguments. Add tests with the add_test...
Read more >add_test: dependency to called exe built by add_executable ...
add the feature to optionally add to add_test a cmake target - as opposed to a ctest name - which should be updated...
Read more >Device target column - Search Ads 360 Help - Google Support
Indicates the type of device the test runs on. For example, a Mobile test runs only when customers search from mobile devices. Applicable...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I tested again (maybe update) and it’s working
In the terminal. Seeing how the command behaves that way will give me more clues about what to do. For example, as I see in your CMakeLists, you define the test with “Tests” so I wonder why the extension generates the command with “-T test” instead of “-T tests”. So just curious what happens in terminal for all these situations and then I’ll have a better idea of how to approach a bug fix for this.