From 9eba823269fffa8f1a5c780c937c202672b636fe Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Wed, 14 Dec 2016 23:11:20 -0800 Subject: [PATCH 01/21] Demonstrate that compiler is identified as MSVC when VS2014 Clang extension is used --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7411bc..2d6c28c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,15 +11,19 @@ option(UTPP_AMPLIFY_WARNINGS "Set this to OFF if you wish to use CMake default warning levels; should generally only use to work around support issues for your specific compiler" ON) +message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}") if(MSVC14 OR MSVC12) + message(STATUS "Using MSVC compiler") # has the support we need else() include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX14) + message(STATUS "Specify C++14") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") elseif(COMPILER_SUPPORTS_CXX11) + message(STATUS "Specify C++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else() message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") From 8f7a2634462011b9b366704e480d25fe7fc2f626 Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Thu, 15 Dec 2016 00:31:56 -0800 Subject: [PATCH 02/21] Increase CMake version to resolve developer warnings regarding implicit quoted dereference in STREQUAL comparison --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d6c28c..4f8c8db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.1) +cmake_minimum_required(VERSION 3.1.0) project(UnitTest++) option(UTPP_USE_PLUS_SIGN From c4ab9d31ed98da89bf1f07738129139eb0034dd8 Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Thu, 15 Dec 2016 00:40:03 -0800 Subject: [PATCH 03/21] Identify Clang compiler when used as an MSVC extension --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f8c8db..000fd6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,22 +11,24 @@ option(UTPP_AMPLIFY_WARNINGS "Set this to OFF if you wish to use CMake default warning levels; should generally only use to work around support issues for your specific compiler" ON) -message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}") -if(MSVC14 OR MSVC12) - message(STATUS "Using MSVC compiler") - # has the support we need +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + # CHECK_CXX_COMPILER_FLAG could be used + # but MSVC version is preferred for feature requirements + if (MSVC14 OR MSVC12) + # has the support we need + else() + message(WARNING "The MSVC compiler version does not support required C++11 features. Please use a different C++ compiler.") + endif() else() include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX14) - message(STATUS "Specify C++14") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") elseif(COMPILER_SUPPORTS_CXX11) - message(STATUS "Specify C++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else() - message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") + message(WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") endif() endif() From bb495391070e2a87503f9d3dba723b62a90a5032 Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Thu, 15 Dec 2016 02:46:13 -0800 Subject: [PATCH 04/21] Revert "Increase CMake version to resolve developer warnings regarding implicit quoted dereference in STREQUAL comparison" This reverts commit 8f7a2634462011b9b366704e480d25fe7fc2f626. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 000fd6b..f075074 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 2.8.1) project(UnitTest++) option(UTPP_USE_PLUS_SIGN From a2fe23887a793c42b35c7be54bd9e06023bc36b7 Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Thu, 15 Dec 2016 02:50:09 -0800 Subject: [PATCH 05/21] =?UTF-8?q?Use=20=E2=80=9CMATCHES=E2=80=9D=20instead?= =?UTF-8?q?=20of=20=E2=80=9CSTREQUAL=E2=80=9D=20to=20avoid=20ambiguous=20c?= =?UTF-8?q?omparison.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NOTE: Unlike STREQUAL this comparison is supported pre and post CMake v3.1.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f075074..4c39baf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ option(UTPP_AMPLIFY_WARNINGS "Set this to OFF if you wish to use CMake default warning levels; should generally only use to work around support issues for your specific compiler" ON) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +if(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC") # CHECK_CXX_COMPILER_FLAG could be used # but MSVC version is preferred for feature requirements if (MSVC14 OR MSVC12) From 85bade33f596a4dab33eb6d44f662d64fc20f510 Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Sat, 14 Jan 2017 23:00:24 +0800 Subject: [PATCH 06/21] cmake: fix pkgconfig dir path on FreeBSD --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb10f47..a0f5511 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,5 +106,10 @@ set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin) set(libdir ${CMAKE_INSTALL_PREFIX}/lib) set(includedir ${CMAKE_INSTALL_PREFIX}/include/UnitTest++) configure_file("UnitTest++.pc.in" "UnitTest++.pc" @ONLY) +if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + set(pkgconfdir ${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig) +else() + set(pkgconfdir ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) +endif() install(FILES "${CMAKE_CURRENT_BINARY_DIR}/UnitTest++.pc" - DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") + DESTINATION "${pkgconfdir}") From 0757ba8f903fc94ac852c8ba394cd96358b0e2c7 Mon Sep 17 00:00:00 2001 From: Christoph Willing Date: Mon, 23 Jan 2017 17:49:12 +1000 Subject: [PATCH 07/21] Add support for LIB_SUFFIX Signed-off-by: Christoph Willing --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0f5511..6b490ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,8 @@ option(UTPP_AMPLIFY_WARNINGS "Set this to OFF if you wish to use CMake default warning levels; should generally only use to work around support issues for your specific compiler" ON) +set(LIB_SUFFIX "" CACHE STRING "Identifier to add to end of lib directory name e.g. 64 for lib64") + if(MSVC14 OR MSVC12) # has the support we need else() @@ -92,10 +94,10 @@ else() set (UTPP_INSTALL_DESTINATION "include/UnitTestPP") endif() -set(config_install_dir_ lib/cmake/${PROJECT_NAME}) +set(config_install_dir_ lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}) set(targets_export_name_ "${PROJECT_NAME}Targets") -install(TARGETS UnitTest++ EXPORT "${targets_export_name_}" DESTINATION lib) +install(TARGETS UnitTest++ EXPORT "${targets_export_name_}" DESTINATION lib${LIB_SUFFIX}) install(FILES ${headers_} DESTINATION ${UTPP_INSTALL_DESTINATION}) install(FILES ${platformHeaders_} DESTINATION ${UTPP_INSTALL_DESTINATION}/${platformDir_}) install(FILES cmake/UnitTest++Config.cmake DESTINATION "${config_install_dir_}") @@ -103,13 +105,13 @@ install(EXPORT "${targets_export_name_}" DESTINATION "${config_install_dir_}") set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin) -set(libdir ${CMAKE_INSTALL_PREFIX}/lib) +set(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) set(includedir ${CMAKE_INSTALL_PREFIX}/include/UnitTest++) configure_file("UnitTest++.pc.in" "UnitTest++.pc" @ONLY) if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") set(pkgconfdir ${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig) else() - set(pkgconfdir ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) + set(pkgconfdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig) endif() install(FILES "${CMAKE_CURRENT_BINARY_DIR}/UnitTest++.pc" DESTINATION "${pkgconfdir}") From d7bd757862916cca0c4888070c9c929a8a9bd089 Mon Sep 17 00:00:00 2001 From: timdave13 Date: Thu, 2 Feb 2017 17:14:27 -0500 Subject: [PATCH 08/21] fix clang warning fix clang warning: 'X' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Wweak-vtables] --- UnitTest++/TestMacros.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UnitTest++/TestMacros.h b/UnitTest++/TestMacros.h index d6bc204..8ff87f8 100644 --- a/UnitTest++/TestMacros.h +++ b/UnitTest++/TestMacros.h @@ -49,10 +49,12 @@ explicit Fixture ## Name ## Helper(UnitTest::TestDetails const& details) : m_details(details) {} \ void RunImpl(); \ UnitTest::TestDetails const& m_details; \ + virtual ~Fixture ## Name ## Helper(); \ private: \ Fixture ## Name ## Helper(Fixture ## Name ## Helper const&); \ Fixture ## Name ## Helper& operator =(Fixture ## Name ## Helper const&); \ }; \ + Fixture ## Name ## Helper::~Fixture ## Name ## Helper(){}; \ \ class Test ## Fixture ## Name : public UnitTest::Test \ { \ @@ -60,9 +62,9 @@ Test ## Fixture ## Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \ private: \ virtual void RunImpl() const; \ - } test ## Fixture ## Name ## Instance; \ + } static test ## Fixture ## Name ## Instance; \ \ - UnitTest::ListAdder adder ## Fixture ## Name (List, &test ## Fixture ## Name ## Instance); \ + static UnitTest::ListAdder adder ## Fixture ## Name (List, &test ## Fixture ## Name ## Instance); \ \ void Test ## Fixture ## Name::RunImpl() const \ { \ From 0a6857e3883175a5682bc2a7df9e7b53f73f53a9 Mon Sep 17 00:00:00 2001 From: Tim Bochenek Date: Thu, 2 Feb 2017 18:03:59 -0500 Subject: [PATCH 09/21] fix clang warning fix clang warning 'extra ';' outside function is c++11 extension --- UnitTest++/TestMacros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitTest++/TestMacros.h b/UnitTest++/TestMacros.h index 8ff87f8..dbe3430 100644 --- a/UnitTest++/TestMacros.h +++ b/UnitTest++/TestMacros.h @@ -54,7 +54,7 @@ Fixture ## Name ## Helper(Fixture ## Name ## Helper const&); \ Fixture ## Name ## Helper& operator =(Fixture ## Name ## Helper const&); \ }; \ - Fixture ## Name ## Helper::~Fixture ## Name ## Helper(){}; \ + Fixture ## Name ## Helper::~Fixture ## Name ## Helper(){} \ \ class Test ## Fixture ## Name : public UnitTest::Test \ { \ From 0b15459ee4fbee824c6a699d4c64fba8e49b8339 Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Thu, 2 Feb 2017 21:56:48 -0800 Subject: [PATCH 10/21] Downgrade message to STATUS and do not declare C++11 as a requirement. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c39baf..2ed7b67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC") if (MSVC14 OR MSVC12) # has the support we need else() - message(WARNING "The MSVC compiler version does not support required C++11 features. Please use a different C++ compiler.") + message(STATUS "The MSVC compiler version does not support UnitTest++ C++11 features.") endif() else() include(CheckCXXCompilerFlag) @@ -28,7 +28,7 @@ else() elseif(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else() - message(WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") + message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.") endif() endif() From 07d4872076b3b7d824149186a230f54ef5cd04df Mon Sep 17 00:00:00 2001 From: Tim Bochenek Date: Fri, 3 Feb 2017 08:19:17 -0500 Subject: [PATCH 11/21] fix clang warnings fix clang warning warning: no previous extern declaration for non-static variable 'X' [-Wmissing-variable-declarations] --- UnitTest++/TestMacros.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/UnitTest++/TestMacros.h b/UnitTest++/TestMacros.h index dbe3430..0c8e903 100644 --- a/UnitTest++/TestMacros.h +++ b/UnitTest++/TestMacros.h @@ -25,16 +25,16 @@ } \ namespace Suite ## Name -#define UNITTEST_IMPL_TEST(Name, List) \ +#define UNITTEST_IMPL_TEST(Name, List) \ class Test ## Name : public UnitTest::Test \ { \ public: \ Test ## Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \ private: \ virtual void RunImpl() const; \ - } test ## Name ## Instance; \ + } static test ## Name ## Instance; \ \ - UnitTest::ListAdder adder ## Name (List, &test ## Name ## Instance); \ + static UnitTest::ListAdder adder ## Name (List, &test ## Name ## Instance); \ \ void Test ## Name::RunImpl() const @@ -62,9 +62,9 @@ Test ## Fixture ## Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \ private: \ virtual void RunImpl() const; \ - } static test ## Fixture ## Name ## Instance; \ + } static test ## Fixture ## Name ## Instance; \ \ - static UnitTest::ListAdder adder ## Fixture ## Name (List, &test ## Fixture ## Name ## Instance); \ + static UnitTest::ListAdder adder ## Fixture ## Name (List, &test ## Fixture ## Name ## Instance); \ \ void Test ## Fixture ## Name::RunImpl() const \ { \ From 33e63147539750304216b22b01c8968432c959b8 Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Mon, 22 May 2017 00:22:38 +0900 Subject: [PATCH 12/21] Added autogen.sh file to ease autotools installation --- autogen.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 autogen.sh diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..347366d --- /dev/null +++ b/autogen.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +test -e ./.autotools_aux || mkdir .autotools_aux + +libtoolize -cq +aclocal -I m4 --install # Generate aclocal +autoconf # Generate configure script +autoheader # Generate config.h +automake --add-missing --copy # Generate Makefile.in and other scripts From a6fdaeef1269e50c8777989d4338cc39a5a0f6a3 Mon Sep 17 00:00:00 2001 From: Martin Moene Date: Sat, 8 Jul 2017 11:09:38 +0200 Subject: [PATCH 13/21] Use if (MSVC) as per issue #160 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e60f81b..a683ea1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ option(UTPP_AMPLIFY_WARNINGS set(LIB_SUFFIX "" CACHE STRING "Identifier to add to end of lib directory name e.g. 64 for lib64") -if(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC") +if (MSVC) # CHECK_CXX_COMPILER_FLAG could be used # but MSVC version is preferred for feature requirements if (MSVC14 OR MSVC12) From a7d506d7ebbea35cc089b319443cd899d440132c Mon Sep 17 00:00:00 2001 From: Flow86 Date: Wed, 20 Mar 2019 13:19:15 +0100 Subject: [PATCH 14/21] add support to build unittest cpp on AIX (IBM) --- UnitTest++/Config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitTest++/Config.h b/UnitTest++/Config.h index 4bebf1a..14429ee 100644 --- a/UnitTest++/Config.h +++ b/UnitTest++/Config.h @@ -22,7 +22,7 @@ #if defined(unix) || defined(__unix__) || defined(__unix) || defined(linux) || \ defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) \ - || defined (__HAIKU__) + || defined (__HAIKU__) || defined(_AIX) #define UNITTEST_POSIX #endif From bdef2bdd62598afc31e17b24349b47d3813eed57 Mon Sep 17 00:00:00 2001 From: Dan Huantes Date: Wed, 14 Aug 2019 11:32:00 -0500 Subject: [PATCH 15/21] UnitTest++ now correctly supports CMake's find_package config mode [CMakeLists.txt] - Bumped cmake minimum requirement to go to 3.0 as this appears to be earliest version that transitive usage requirements are supported. - Added version to project so that is evident when looking at CMakeLists.txt - Removed include_directories as that command affects more than just UnitTest++ in favor of target_include_directories. - The target_include_directories uses the generator expressions to do the same thing for the BUILD_INTERFACE condition but only affects UnitTest++. The INSTALL_INTERFACE ensures that when UnitTest++ is installed client applications calling find_package for UnitTest++ only have to add the UnitTest++ target to the target_link_libraries and will get the correct include path for UnitTest++ added to their include paths. - Added DEBUG_POSTFIX to both library and unit test to distinguish them from each other as they are installed into the same directory and would otherwise overwrite one another. - Added Versioning using write_basic_package_version_file to the install so that a client can call find_package(UnitTest++ 2.1 REQUIRED) and it will be able to confirm the version. If the version is updated you could theoretically ahve a version 2.2, 2.3 ,etc... and the find_package mechanism will find the correct one. the SameMajorVersion option in that call indicates that 2.3 is compatible with 2.1 or in other words if find_package(UnitTest++ 2.1 REQUIRED) is called and 2.3 is installed that satisfies the condition but if only 3.0 was installed it will fail because of 'SameMajorVersion'. - Also added installation for the Version file. --- CMakeLists.txt | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a683ea1..03a4f62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8.1) -project(UnitTest++) +cmake_minimum_required(VERSION 3.0) +project(UnitTest++ VERSION 2.1) option(UTPP_USE_PLUS_SIGN "Set this to OFF if you wish to use '-cpp' instead of '++' in lib/include paths" @@ -74,7 +74,7 @@ endif() file(GLOB TEST_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tests/*.cpp tests/*.h) source_group( "" FILES ${TEST_SRCS}) add_executable(TestUnitTest++ ${TEST_SRCS}) -include_directories(.) + if(${UTPP_USE_PLUS_SIGN}) set_target_properties(TestUnitTest++ PROPERTIES OUTPUT_NAME TestUnitTest++) @@ -100,13 +100,30 @@ else() set (UTPP_INSTALL_DESTINATION "include/UnitTestPP") endif() +target_include_directories( UnitTest++ + PUBLIC + $ + $ + ) +set_target_properties(UnitTest++ PROPERTIES DEBUG_POSTFIX "-d") +set_target_properties(TestUnitTest++ PROPERTIES DEBUG_POSTFIX "-d") + set(config_install_dir_ lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}) set(targets_export_name_ "${PROJECT_NAME}Targets") +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + cmake/UnitTest++ConfigVersion.cmake + VERSION ${UnitTest++_VERSION} + COMPATIBILITY SameMajorVersion + ) install(TARGETS UnitTest++ EXPORT "${targets_export_name_}" DESTINATION lib${LIB_SUFFIX}) install(FILES ${headers_} DESTINATION ${UTPP_INSTALL_DESTINATION}) install(FILES ${platformHeaders_} DESTINATION ${UTPP_INSTALL_DESTINATION}/${platformDir_}) -install(FILES cmake/UnitTest++Config.cmake DESTINATION "${config_install_dir_}") +install(FILES + cmake/UnitTest++Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/cmake/UnitTest++ConfigVersion.cmake + DESTINATION "${config_install_dir_}") install(EXPORT "${targets_export_name_}" DESTINATION "${config_install_dir_}") set(prefix ${CMAKE_INSTALL_PREFIX}) From 2423fcac7668aa9c331a2dcf024c3ca06742942d Mon Sep 17 00:00:00 2001 From: Dan Huantes Date: Thu, 15 Aug 2019 08:26:41 -0500 Subject: [PATCH 16/21] CrasingTestsAreReportedAsFailures no longer core dumps on Clang Release Found that Crashing tests at some point in Clang history were actually caught but testing on Clang 6.0 and Clang 7.0 this is not the case. So added Clang to the list of compilers that don't run this tests. Noted that several other Pull Requests were failing for the same reason. --- tests/TestTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestTest.cpp b/tests/TestTest.cpp index 5a4e1ca..0db0650 100644 --- a/tests/TestTest.cpp +++ b/tests/TestTest.cpp @@ -72,7 +72,7 @@ namespace { CHECK_EQUAL(1, results.GetFailureCount()); } -#if !defined(UNITTEST_MINGW) && !defined(UNITTEST_WIN32) +#if !defined(UNITTEST_MINGW) && !defined(UNITTEST_WIN32) && !defined(__clang__) // Skip this test in debug because some debuggers don't like it. #if defined(NDEBUG) TEST(CrashingTestsAreReportedAsFailures) From c26966668191029f50d3e9f7318e176e5bbd74fc Mon Sep 17 00:00:00 2001 From: Dan Huantes Date: Thu, 17 Oct 2019 08:23:46 -0500 Subject: [PATCH 17/21] Version made explicitly 3 parts - Updated to appveyor.yml and configure.ac to 2.1.0 to match CMake project version. --- CMakeLists.txt | 2 +- appveyor.yml | 2 +- configure.ac | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03a4f62..7a3fb55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.0) -project(UnitTest++ VERSION 2.1) +project(UnitTest++ VERSION 2.1.0) option(UTPP_USE_PLUS_SIGN "Set this to OFF if you wish to use '-cpp' instead of '++' in lib/include paths" diff --git a/appveyor.yml b/appveyor.yml index bebe4f5..3a4637d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.0.0.{build} +version: 2.1.0.{build} os: - Windows Server 2012 R2 diff --git a/configure.ac b/configure.ac index 56300a6..372f576 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ AM_CONDITIONAL([WINDOWS], LT_INIT() -AC_SUBST([LIBUNITTEST_SO_VERSION], [2:0:0]) +AC_SUBST([LIBUNITTEST_SO_VERSION], [2:1:0]) # Checks for programs. AC_PROG_CXX From f871471d9020788eb0c05582f6430cca36397424 Mon Sep 17 00:00:00 2001 From: Dan Huantes Date: Tue, 7 Apr 2020 18:07:24 -0500 Subject: [PATCH 18/21] Added Namespace to Exported Target [CMakeLists.txt] - It is standard practice to have a namespace for an imported target. Added UnitTest++:: as the namespace argument so that find_package(UnitTest++) will result in UnitTest++::UnitTest++ target that will be used in target_link_libraries. - Updated target_link_libraries for TestUnitTest++ as an example --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a3fb55..b4c75c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,8 @@ source_group(${platformDir_} FILES ${platformHeaders_} ${platformSources_}) # create the lib add_library(UnitTest++ STATIC ${headers_} ${sources_} ${platformHeaders_} ${platformSources_}) +add_library(UnitTest++::UnitTest++ ALIAS UnitTest++) + if(${UTPP_USE_PLUS_SIGN}) set_target_properties(UnitTest++ PROPERTIES OUTPUT_NAME UnitTest++) @@ -80,7 +82,10 @@ if(${UTPP_USE_PLUS_SIGN}) set_target_properties(TestUnitTest++ PROPERTIES OUTPUT_NAME TestUnitTest++) endif() -target_link_libraries(TestUnitTest++ UnitTest++) +target_link_libraries(TestUnitTest++ + PUBLIC + UnitTest++::UnitTest++ + ) # run unit tests as post build step add_custom_command(TARGET TestUnitTest++ @@ -124,7 +129,7 @@ install(FILES cmake/UnitTest++Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/cmake/UnitTest++ConfigVersion.cmake DESTINATION "${config_install_dir_}") -install(EXPORT "${targets_export_name_}" DESTINATION "${config_install_dir_}") +install(EXPORT "${targets_export_name_}" NAMESPACE "UnitTest++::" DESTINATION "${config_install_dir_}") set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin) From 37df68be21fd3bcadea0c54fe5e7d5176c1801ce Mon Sep 17 00:00:00 2001 From: Patrick Johnmeyer Date: Mon, 17 Aug 2020 19:53:58 -0500 Subject: [PATCH 19/21] Add hiatus note & link to issue --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7c138a8..e0b2978 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +> ### Maintenance of UnitTest++, recently sporadic, is officially on hiatus until 1 October 2020. Subscribe to https://github.com/unittest-cpp/unittest-cpp/issues/180 for updates. + + [![Build Status](https://travis-ci.org/unittest-cpp/unittest-cpp.svg?branch=master)](https://travis-ci.org/unittest-cpp/unittest-cpp) [![Build status](https://ci.appveyor.com/api/projects/status/ffs2k8dddts5cyok/branch/master?svg=true)](https://ci.appveyor.com/project/pjohnmeyer/unittest-cpp/branch/master) From 854cae2518d280f732b593cbc9a1c305cb6a753a Mon Sep 17 00:00:00 2001 From: Patrick Johnmeyer Date: Thu, 1 Oct 2020 19:56:11 -0500 Subject: [PATCH 20/21] Extend hiatus to 15 October See #180 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0b2978..8de8c90 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -> ### Maintenance of UnitTest++, recently sporadic, is officially on hiatus until 1 October 2020. Subscribe to https://github.com/unittest-cpp/unittest-cpp/issues/180 for updates. +> ### Maintenance of UnitTest++, recently sporadic, is officially on hiatus until 15 October 2020. Subscribe to https://github.com/unittest-cpp/unittest-cpp/issues/180 for updates. [![Build Status](https://travis-ci.org/unittest-cpp/unittest-cpp.svg?branch=master)](https://travis-ci.org/unittest-cpp/unittest-cpp) From 10e50ad70c696002b1d5bbefd0ea04b3ea92a03b Mon Sep 17 00:00:00 2001 From: Patrick Johnmeyer Date: Thu, 12 Nov 2020 23:26:38 -0600 Subject: [PATCH 21/21] Extend hiatus to 26 November --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8de8c90..6ece10e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -> ### Maintenance of UnitTest++, recently sporadic, is officially on hiatus until 15 October 2020. Subscribe to https://github.com/unittest-cpp/unittest-cpp/issues/180 for updates. +> ### Maintenance of UnitTest++, recently sporadic, is officially on hiatus until 26 November 2020. Subscribe to https://github.com/unittest-cpp/unittest-cpp/issues/180 for updates. [![Build Status](https://travis-ci.org/unittest-cpp/unittest-cpp.svg?branch=master)](https://travis-ci.org/unittest-cpp/unittest-cpp)