mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-17 03:02:24 +01:00
Added trivial test executable which doesn't use Catch's main() function.
This commit is contained in:
parent
dd2810d60a
commit
70178026e6
@ -23,13 +23,15 @@ set(SOURCES
|
||||
${SELF_TEST_DIR}/VariadicMacrosTests.cpp
|
||||
)
|
||||
|
||||
# configure the executable
|
||||
# configure the executables
|
||||
include_directories(${CATCH_DIR}/include)
|
||||
add_executable(SelfTest ${SOURCES})
|
||||
add_executable(SelfTestExternalMain ${SELF_TEST_DIR}/TestExternalMain.cpp)
|
||||
|
||||
# configure unit tests via CTest
|
||||
enable_testing()
|
||||
add_test(NAME RunTests COMMAND SelfTest)
|
||||
add_test(NAME RunExternalMainTests COMMAND SelfTestExternalMain)
|
||||
|
||||
add_test(NAME ListTests COMMAND SelfTest --list-tests)
|
||||
set_tests_properties(ListTests PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ test cases")
|
||||
|
14
projects/SelfTest/TestExternalMain.cpp
Normal file
14
projects/SelfTest/TestExternalMain.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Created by Fraser on 07/03/2014.
|
||||
* Copyright 2014 Two Blue Cubes Ltd
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#include "catch.hpp"
|
||||
|
||||
int main (int argc, char * const argv[]) {
|
||||
return Catch::Session().run( argc, argv );
|
||||
}
|
Loading…
Reference in New Issue
Block a user