6193: Add target `run_cxx_tests` to only run C++ tests r=def- a=heinrich5991

Requested by Chairn, because the Rust tests are slow on their computer.

## Checklist

- [x] Tested the change ~~ingame~~
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
This commit is contained in:
bors[bot] 2022-12-25 22:58:04 +00:00 committed by GitHub
commit 139cf149a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2751,12 +2751,15 @@ if(GTEST_FOUND OR DOWNLOAD_GTEST)
list(APPEND TARGETS_OWN ${TARGET_TESTRUNNER})
list(APPEND TARGETS_LINK ${TARGET_TESTRUNNER})
add_custom_target(run_tests
add_custom_target(run_cxx_tests
COMMAND $<TARGET_FILE:${TARGET_TESTRUNNER}> ${TESTRUNNER_ARGS}
COMMENT Running unit tests
DEPENDS ${TARGET_TESTRUNNER}
USES_TERMINAL
)
add_custom_target(run_tests
DEPENDS run_cxx_tests
)
if(NOT MSVC OR CMAKE_BUILD_TYPE STREQUAL Release)
# On MSVC, Rust tests only work in the release mode because we link our C++
# code with the debug C standard library (/MTd) but Rust only supports