1 // 000-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 // That's it 12 13 // Compile implementation of Catch for use with files that do contain tests: 14 // - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -c 000-CatchMain.cpp 15 // - cl -EHsc -I%CATCH_SINGLE_INCLUDE% -c 000-CatchMain.cpp 16