diff --git a/CMakeLists.txt b/CMakeLists.txt index b22fe2c0c..f82909f9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,7 +411,7 @@ if(RUN_TESTS) include_directories(${GTEST_INCLUDE_DIRS}) add_definitions(-fprofile-arcs -ftest-coverage -DRUN_TESTS) target_link_libraries(${BIN_TARGET} PRIVATE -fprofile-arcs ${GTEST_LIBRARIES}) - gtest_add_tests(${BIN_TARGET} "" AUTO) + gtest_add_tests(${BIN_TARGET} "--tests-only" AUTO) endif() target_include_directories(devilution PUBLIC Source SourceS ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/SourceX/main.cpp b/SourceX/main.cpp index 0b1e867dd..dcae8fe10 100644 --- a/SourceX/main.cpp +++ b/SourceX/main.cpp @@ -22,7 +22,10 @@ int main(int argc, char **argv) { #ifdef RUN_TESTS testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); + auto test_result = RUN_ALL_TESTS(); + for(auto i = 0; i < argc; ++i) + if(strcasecmp(argv[i], "--tests-only") == 0) + return test_result; #endif #ifdef __SWITCH__ switch_enable_network(); @@ -30,6 +33,5 @@ int main(int argc, char **argv) #ifdef __3DS__ ctr_sys_init(); #endif - return dvl::DiabloMain(argc, argv); }