1 // 200-Rpt-CatchMain.cpp 2 3 // In a Catch project with multiple files, dedicate one file to compile the 4 // source code of Catch itself and reuse the resulting object file for linking. 5 6 // Let Catch provide main(): 7 #define CATCH_CONFIG_MAIN 8 9 #include <catch2/catch.hpp> 10 11 #ifdef CATCH_EXAMPLE_RPT_1 12 #include CATCH_EXAMPLE_RPT_1 13 #endif 14 15 #ifdef CATCH_EXAMPLE_RPT_2 16 #include CATCH_EXAMPLE_RPT_2 17 #endif 18 19 #ifdef CATCH_EXAMPLE_RPT_3 20 #include CATCH_EXAMPLE_RPT_3 21 #endif 22 23 // That's it 24 25 // Compile implementation of Catch for use with files that do contain tests: 26 // - g++ -std=c++11 -Wall -I$(CATCH_ROOT) -DCATCH_EXAMPLE_RPT_1=\"include/reporters/catch_reporter_teamcity.hpp\" -o 200-Rpt-CatchMainTeamCity.o -c 200-Rpt-CatchMain.cpp 27 // cl -EHsc -I%CATCH_ROOT% -DCATCH_EXAMPLE_RPT_1=\"include/reporters/catch_reporter_teamcity.hpp\" -Fo200-Rpt-CatchMainTeamCity.obj -c 200-Rpt-CatchMain.cpp 28