configure catch2 framework

This commit is contained in:
Jan Schreiber 2020-09-04 10:33:33 +02:00
parent 2198f80e22
commit 5eacc49a62
3 changed files with 22 additions and 17799 deletions

View file

@ -29,6 +29,7 @@ find_package(Qt5 COMPONENTS Widgets REQUIRED)
find_package(cppzmq REQUIRED) find_package(cppzmq REQUIRED)
find_package(nlohmann_json REQUIRED) find_package(nlohmann_json REQUIRED)
find_package(SQLite3 REQUIRED) find_package(SQLite3 REQUIRED)
find_package(Catch2 REQUIRED)
add_executable(littlesnitch add_executable(littlesnitch
main.cpp main.cpp
@ -49,4 +50,17 @@ add_executable(littlesnitch
editandresend.ui editandresend.ui
) )
target_include_directories(littlesnitch PRIVATE /usr/local/include)
target_link_libraries(littlesnitch PRIVATE Qt5::Widgets cppzmq sqlite3) target_link_libraries(littlesnitch PRIVATE Qt5::Widgets cppzmq sqlite3)
add_executable(littlesnitch_tests
tests/generic_tests.cpp
networkthread.cpp
)
target_include_directories(littlesnitch_tests PRIVATE /usr/local/include)
target_link_libraries(littlesnitch_tests PRIVATE Qt5::Widgets cppzmq sqlite3 Catch2::Catch2)
include(CTest)
include(Catch)
catch_discover_tests(littlesnitch_tests)

File diff suppressed because it is too large Load diff

8
tests/generic_tests.cpp Normal file
View file

@ -0,0 +1,8 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include "networkthread.h"
TEST_CASE( "1 eq 1", "[test]" ) {
REQUIRE( 1 == 1 );
}