000-CatchMain.cpp 488 B

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