200-Rpt-CatchMain.cpp 884 B

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