Added trivial test executable which doesn't use Catch's main() function.

This commit is contained in:
Fraser Hutchison 2014-03-07 21:48:46 +00:00
parent dd2810d60a
commit 70178026e6
2 changed files with 17 additions and 1 deletions

View File

@ -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")

View 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 );
}