question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adds target to CTest

See original GitHub issue

hi, 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:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Samega7Cattaccommented, Oct 20, 2021

I tested again (maybe update) and it’s working

0reactions
andreeiscommented, Jun 17, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found