diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt index c31ec32b..b4f8d959 100644 --- a/projects/CMake/CMakeLists.txt +++ b/projects/CMake/CMakeLists.txt @@ -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") diff --git a/projects/SelfTest/TestExternalMain.cpp b/projects/SelfTest/TestExternalMain.cpp new file mode 100644 index 00000000..9e978c3e --- /dev/null +++ b/projects/SelfTest/TestExternalMain.cpp @@ -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 ); +}