Compare commits

..

30 commits

Author SHA1 Message Date
Patrick Johnmeyer
10e50ad70c
Extend hiatus to 26 November 2020-11-12 23:26:38 -06:00
Patrick Johnmeyer
854cae2518
Extend hiatus to 15 October
See #180
2020-10-01 19:56:11 -05:00
Patrick Johnmeyer
37df68be21
Add hiatus note & link to issue 2020-08-17 19:53:58 -05:00
Patrick Johnmeyer
0ea55a251b
Merge pull request #173 from dhuantes/install-improvements
UnitTest++ now correctly supports CMake's find_package config mode
2020-04-18 19:17:46 -05:00
Dan Huantes
f871471d90 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
2020-04-07 18:07:24 -05:00
Dan Huantes
c269666681 Version made explicitly 3 parts
- Updated to appveyor.yml and
configure.ac to 2.1.0 to
match CMake project version.
2019-10-17 08:23:46 -05:00
Patrick Johnmeyer
d355e127be
Merge pull request #172 from Flow86/patch-1
add support to build unittest cpp on AIX (IBM)
2019-10-15 21:27:12 -05:00
Dan Huantes
2423fcac76 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.
2019-08-15 08:30:43 -05:00
Dan Huantes
bdef2bdd62 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.
2019-08-15 07:26:45 -05:00
Flow86
a7d506d7eb
add support to build unittest cpp on AIX (IBM) 2019-03-20 13:19:15 +01:00
Patrick Johnmeyer
bc5d87f484 Merge pull request #161 from martinmoene/cmake
Use if (MSVC) as per issue #160
2017-07-08 10:06:47 -05:00
Martin Moene
a6fdaeef12 Use if (MSVC) as per issue #160 2017-07-08 11:09:38 +02:00
Patrick Johnmeyer
85b3666173 Merge pull request #149 from timdave13/patch-1
fix clang warnings
2017-07-07 23:16:00 -05:00
Patrick Johnmeyer
8c460c48e6 Merge pull request #141 from Reification/feature-MSVC-Clang
Feature msvc clang
2017-06-30 23:46:28 -05:00
Patrick Johnmeyer
65af507437 Merge pull request #155 from vicentebolea/adding-autogen-script
Added autogen.sh file to ease autotools installation
2017-06-30 23:35:29 -05:00
Patrick Johnmeyer
ee996164f2 Merge branch 'master' into feature-MSVC-Clang 2017-06-30 23:31:18 -05:00
Patrick Johnmeyer
af28992c5d Merge pull request #148 from cwilling/add-lib_dir
Add support for LIB_SUFFIX
2017-06-30 23:13:06 -05:00
Vicente Adolfo Bolea Sanchez
33e6314753 Added autogen.sh file to ease autotools installation 2017-05-22 00:22:38 +09:00
Tim Bochenek
07d4872076 fix clang warnings
fix clang warning warning: no previous extern declaration for non-static variable 'X' [-Wmissing-variable-declarations]
2017-02-03 08:19:17 -05:00
Gabriel Hare
0b15459ee4 Downgrade message to STATUS and do not declare C++11 as a requirement. 2017-02-02 21:56:48 -08:00
Tim Bochenek
0a6857e388 fix clang warning
fix clang warning 'extra ';' outside function is c++11 extension
2017-02-02 18:03:59 -05:00
timdave13
d7bd757862 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]
2017-02-02 17:14:27 -05:00
Christoph Willing
0757ba8f90
Add support for LIB_SUFFIX
Signed-off-by: Christoph Willing <chris.willing@iinet.net.au>
2017-01-23 17:49:12 +10:00
Patrick Johnmeyer
c331bb0dea Merge pull request #146 from iblis17/fbsd-cmake
cmake: fix pkgconfig dir path on FreeBSD
2017-01-19 19:00:12 -06:00
Iblis Lin
85bade33f5 cmake: fix pkgconfig dir path on FreeBSD 2017-01-14 23:00:24 +08:00
Gabriel Hare
a2fe23887a Use “MATCHES” instead of “STREQUAL” to avoid ambiguous comparison.
NOTE: Unlike STREQUAL this comparison is supported pre and post CMake v3.1.0
2016-12-15 02:50:09 -08:00
Gabriel Hare
bb49539107 Revert "Increase CMake version to resolve developer warnings regarding implicit quoted dereference in STREQUAL comparison"
This reverts commit 8f7a263446.
2016-12-15 02:46:13 -08:00
Gabriel Hare
c4ab9d31ed Identify Clang compiler when used as an MSVC extension 2016-12-15 00:40:03 -08:00
Gabriel Hare
8f7a263446 Increase CMake version to resolve developer warnings regarding implicit quoted dereference in STREQUAL comparison 2016-12-15 00:31:56 -08:00
Gabriel Hare
9eba823269 Demonstrate that compiler is identified as MSVC when VS2014 Clang extension is used 2016-12-14 23:11:20 -08:00
8 changed files with 72 additions and 23 deletions

View file

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.1)
project(UnitTest++)
cmake_minimum_required(VERSION 3.0)
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"
@ -11,8 +11,16 @@ 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(MSVC14 OR MSVC12)
# has the support we need
set(LIB_SUFFIX "" CACHE STRING "Identifier to add to end of lib directory name e.g. 64 for lib64")
if (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(STATUS "The MSVC compiler version does not support UnitTest++ C++11 features.")
endif()
else()
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
@ -22,7 +30,7 @@ else()
elseif(COMPILER_SUPPORTS_CXX11)
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(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
endif()
endif()
@ -56,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++)
@ -66,13 +76,16 @@ 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++)
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++
@ -92,19 +105,41 @@ else()
set (UTPP_INSTALL_DESTINATION "include/UnitTestPP")
endif()
set(config_install_dir_ lib/cmake/${PROJECT_NAME})
set(targets_export_name_ "${PROJECT_NAME}Targets")
target_include_directories( UnitTest++
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/UnitTest++>
)
set_target_properties(UnitTest++ PROPERTIES DEBUG_POSTFIX "-d")
set_target_properties(TestUnitTest++ PROPERTIES DEBUG_POSTFIX "-d")
install(TARGETS UnitTest++ EXPORT "${targets_export_name_}" DESTINATION lib)
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(EXPORT "${targets_export_name_}" 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_}" NAMESPACE "UnitTest++::" 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${LIB_SUFFIX}/pkgconfig)
endif()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/UnitTest++.pc"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
DESTINATION "${pkgconfdir}")

View file

@ -1,3 +1,6 @@
> ### 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)
[![Build status](https://ci.appveyor.com/api/projects/status/ffs2k8dddts5cyok/branch/master?svg=true)](https://ci.appveyor.com/project/pjohnmeyer/unittest-cpp/branch/master)

View file

@ -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

View file

@ -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
@ -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 \
{ \

View file

@ -1,4 +1,4 @@
version: 2.0.0.{build}
version: 2.1.0.{build}
os:
- Windows Server 2012 R2

9
autogen.sh Executable file
View file

@ -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

View file

@ -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

View file

@ -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)