From 39dcba215e546905a001a1c3f3ab6a49c96ffedf Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 13 Jan 2019 22:27:35 +0100 Subject: [PATCH] Let CMake generate code for test application --- CMakeLists.txt | 3 ++- generator/CMakeLists.txt | 3 +-- generator/tests/cppunit.cpp | 1 - lib/CMakeLists.txt | 1 - lib/tests/cppunit.cpp | 1 - 5 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 generator/tests/cppunit.cpp delete mode 100644 lib/tests/cppunit.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 076084f..06b5541 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set(META_VERSION_MINOR 0) set(META_VERSION_PATCH 7) set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH}) set(META_CXX_STANDARD 17) +set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON) # set project name for IDEs like Qt Creator project(${META_PROJECT_NAME}) @@ -46,7 +47,7 @@ else() endif() # find c++utilities -find_package(c++utilities 4.16.0 REQUIRED) +find_package(c++utilities 4.17.0 REQUIRED) # use the source directory of c++utilities for includes rather than the location where headers are going to be installed # note: this enables the tests to find the header files for c++utilities in case it is built within the same project diff --git a/generator/CMakeLists.txt b/generator/CMakeLists.txt index 6c002a3..8bc6a36 100644 --- a/generator/CMakeLists.txt +++ b/generator/CMakeLists.txt @@ -33,7 +33,6 @@ set(TEST_HEADER_FILES tests/helper.h ) set(TEST_SRC_FILES - tests/cppunit.cpp tests/binarygenerator.cpp ) @@ -73,7 +72,7 @@ if(TARGET reflective_rapidjson_generator_tests) INPUT_FILES tests/structs.h # used by test cases tests/morestructs.h # used by test cases - tests/cppunit.cpp # just for testing multiple input files and the "empty file" case + visitor.cpp # arbitrarily chosen source file (just for testing the "no relevant structs/classes" case) GENERATORS json binary diff --git a/generator/tests/cppunit.cpp b/generator/tests/cppunit.cpp deleted file mode 100644 index 67aaee6..0000000 --- a/generator/tests/cppunit.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 7b28316..9ae1e13 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -13,7 +13,6 @@ set(SRC_FILES set(TEST_HEADER_FILES ) set(TEST_SRC_FILES - tests/cppunit.cpp ) set(CMAKE_MODULE_FILES cmake/modules/ReflectionGenerator.cmake diff --git a/lib/tests/cppunit.cpp b/lib/tests/cppunit.cpp deleted file mode 100644 index 67aaee6..0000000 --- a/lib/tests/cppunit.cpp +++ /dev/null @@ -1 +0,0 @@ -#include