From ecbff68b56f9327f3ad1f047a33371a500fcaf59 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Tue, 21 Aug 2018 10:11:27 +0200 Subject: [PATCH] added logging test --- Framework/Logging/CMakeLists.txt | 5 +++++ Framework/Logging/testLogging.cc | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 Framework/Logging/testLogging.cc diff --git a/Framework/Logging/CMakeLists.txt b/Framework/Logging/CMakeLists.txt index 7b684deb1..581df617b 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 000000000..19545a320 --- /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 ); + } +} -- GitLab