mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Integrate CMake with <catch2/catch.hpp>
include paths
This also goes for pkg-config installed by our CMake installation. This includes * Updating CMake version on Travis * Adding a `Catch2` subfolder to the `single_include/` folder to provide this include path both _inside_ the repository, and _outside_. * Updated examples to build with the new paths * Other general CMake cleanup
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
// Let Catch provide main():
|
||||
#define CATCH_CONFIG_MAIN
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
// That's it
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
// Let Catch provide main():
|
||||
#define CATCH_CONFIG_MAIN
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
int Factorial( int number ) {
|
||||
return number <= 1 ? number : Factorial( number - 1 ) * number; // fail
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// Let Catch provide main():
|
||||
#define CATCH_CONFIG_MAIN
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
TEST_CASE( "1: All test cases reside in other .cpp files (empty)", "[multi-file:1]" ) {
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
// main() provided by Catch in file 020-TestCase-1.cpp.
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
int Factorial( int number ) {
|
||||
return number <= 1 ? number : Factorial( number - 1 ) * number; // fail
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
// main() provided in 000-CatchMain.cpp
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
std::string one() {
|
||||
return "1";
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
// main() provided in 000-CatchMain.cpp
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
// main() provided in 000-CatchMain.cpp
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
class DBConnection
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
// main() provided in 000-CatchMain.cpp
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
SCENARIO( "vectors can be sized and resized", "[vector]" ) {
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
// Let Catch provide the required interfaces:
|
||||
#define CATCH_CONFIG_EXTERNAL_INTERFACES
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
#include <iostream>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
@@ -68,16 +68,16 @@ set( TARGETS_ALL ${TARGETS_SINGLE_FILE} ${TARGETS_IDIOMATIC_TESTS} 0
|
||||
|
||||
# define program targets:
|
||||
|
||||
add_library( CatchMain OBJECT ${EXAMPLES_DIR}/${SOURCES_IDIOMATIC_MAIN} ${HEADER_DIR}/catch.hpp )
|
||||
add_library( CatchMain OBJECT ${EXAMPLES_DIR}/${SOURCES_IDIOMATIC_MAIN} ${HEADER_DIR}/catch2/catch.hpp )
|
||||
|
||||
add_executable( 020-TestCase ${EXAMPLES_DIR}/020-TestCase-1.cpp ${EXAMPLES_DIR}/020-TestCase-2.cpp ${HEADER_DIR}/catch.hpp )
|
||||
add_executable( 020-TestCase ${EXAMPLES_DIR}/020-TestCase-1.cpp ${EXAMPLES_DIR}/020-TestCase-2.cpp ${HEADER_DIR}/catch2/catch.hpp )
|
||||
|
||||
foreach( name ${TARGETS_SINGLE_FILE} )
|
||||
add_executable( ${name} ${EXAMPLES_DIR}/${name}.cpp ${HEADER_DIR}/catch.hpp )
|
||||
add_executable( ${name} ${EXAMPLES_DIR}/${name}.cpp ${HEADER_DIR}/catch2/catch.hpp )
|
||||
endforeach()
|
||||
|
||||
foreach( name ${TARGETS_IDIOMATIC_TESTS} )
|
||||
add_executable( ${name} ${EXAMPLES_DIR}/${name}.cpp $<TARGET_OBJECTS:CatchMain> ${HEADER_DIR}/catch.hpp )
|
||||
add_executable( ${name} ${EXAMPLES_DIR}/${name}.cpp $<TARGET_OBJECTS:CatchMain> ${HEADER_DIR}/catch2/catch.hpp )
|
||||
endforeach()
|
||||
|
||||
foreach( name ${TARGETS_ALL} )
|
||||
|
Reference in New Issue
Block a user