diff --git a/Framework/Logging/CMakeLists.txt b/Framework/Logging/CMakeLists.txt index 7b684deb1cff09f2d77db017cf27a58c59d91d71..581df617b38eb288e0f198d60d2cfa18c1e82a7d 100644 --- a/Framework/Logging/CMakeLists.txt +++ b/Framework/Logging/CMakeLists.txt @@ -11,3 +11,8 @@ target_include_directories (CORSIKAlogging INTERFACE $<BUILD_INTERFACE:${PROJECT install (FILES Logger.h Sink.h MessageOn.h MessageOff.h NoSink.h Sink.h BufferedSink.h DESTINATION include/Logging) +# code testing +add_executable (testLogging testLogging.cc) +target_link_libraries (testLogging CORSIKAlogging CORSIKAthirdparty) # for catch2 +add_test (NAME testLogging COMMAND testLogging -o report.xml -r junit) + diff --git a/Framework/Logging/testLogging.cc b/Framework/Logging/testLogging.cc new file mode 100644 index 0000000000000000000000000000000000000000..19545a3203e6100e8da38f6d458ae0a91bd2b3e5 --- /dev/null +++ b/Framework/Logging/testLogging.cc @@ -0,0 +1,22 @@ +#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file +#include <catch2/catch.hpp> + +#include <Logging/Logger.h> + +TEST_CASE( "Logging", "[Logging]" ) +{ + SECTION( "sectionOne" ) + { + REQUIRE( 1/1 == 1 ); + } + + SECTION( "sectionTwo" ) + { + REQUIRE_FALSE( 1/1 == 2 ); + } + + SECTION( "sectionThree" ) + { + REQUIRE( 1/1 == 2 ); + } +}