From d4c2b0f26e08bfff9296113fbf7cc56e396bf366 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 20 Sep 2018 01:53:36 +0300 Subject: [PATCH 1/4] Reformat copyright banners --- CMakeLists.txt | 5 +---- test/CMakeLists.txt | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97f3fab..66c585d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,6 @@ # Copyright 2018 Peter Dimov -# # Distributed under the Boost Software License, Version 1.0. -# -# See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt +# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt cmake_minimum_required(VERSION 3.5) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8c42364..c942f33 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,9 +1,6 @@ # Copyright 2018 Peter Dimov -# # Distributed under the Boost Software License, Version 1.0. -# -# See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt +# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt boost_test(SOURCES assert_test.cpp LIBRARIES Boost::assert Boost::core) boost_test(SOURCES current_function_test.cpp LIBRARIES Boost::assert Boost::core) From 479dabaf8ec92e9c8d545571f318bfbe3ffbaeb1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 20 Sep 2018 01:54:27 +0300 Subject: [PATCH 2/4] Use the correct $ instead of ${CMAKE_CFG_INTDIR} --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66c585d..98b27be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) enable_testing() - add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR}) + add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) function(boost_test) From a26be1fb2fbe88eddbe83fef9ef5c7d39358d460 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 20 Sep 2018 14:19:32 +0300 Subject: [PATCH 3/4] Update copyright on CMakeLists.txt --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98b27be..c4036a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,4 @@ +# Copyright 2018 Mike Dev # Copyright 2018 Peter Dimov # Distributed under the Boost Software License, Version 1.0. # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt From a45445344357be8b5457397bd4086a097d0309c5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 20 Sep 2018 17:47:40 +0300 Subject: [PATCH 4/4] Use mincmake --- CMakeLists.txt | 27 ++------------------------- test/CMakeLists.txt | 18 +++--------------- 2 files changed, 5 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4036a7..e9de4c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,35 +22,12 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) add_subdirectory(../config bin/config) add_subdirectory(../core bin/core) + include(../mincmake/cmake/boost_test.cmake) + enable_testing() add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) - function(boost_test) - - cmake_parse_arguments(_ "" "PREFIX;NAME" "SOURCES;LIBRARIES" ${ARGN}) - - if(NOT __PREFIX) - set(__PREFIX ${PROJECT_NAME}) - endif() - - if(NOT __NAME) - list(GET __SOURCES 0 __NAME) - string(MAKE_C_IDENTIFIER ${__NAME} __NAME) - endif() - - set(__NAME ${__PREFIX}-${__NAME}) - - add_executable(${__NAME} EXCLUDE_FROM_ALL ${__SOURCES}) - target_link_libraries(${__NAME} ${__LIBRARIES}) - - add_test(NAME compile-${__NAME} COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${__NAME}) - - add_test(NAME run-${__NAME} COMMAND ${__NAME}) - set_tests_properties(run-${__NAME} PROPERTIES DEPENDS compile-${__NAME}) - - endfunction(boost_test) - endif() if(COMMAND boost_test) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c942f33..8777910 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,19 +2,7 @@ # Distributed under the Boost Software License, Version 1.0. # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt -boost_test(SOURCES assert_test.cpp LIBRARIES Boost::assert Boost::core) -boost_test(SOURCES current_function_test.cpp LIBRARIES Boost::assert Boost::core) -boost_test(SOURCES verify_test.cpp LIBRARIES Boost::assert Boost::core) -boost_test(SOURCES assert_is_void_test.cpp LIBRARIES Boost::assert Boost::core) +boost_test_jamfile(FILE Jamfile.v2 LIBRARIES Boost::assert Boost::core) -# expansion tests are in exp/ so that there is a backslash in the path on Windows - -boost_test(SOURCES exp/assert_exp_test.cpp LIBRARIES Boost::assert Boost::core) -boost_test(SOURCES exp/assert_msg_exp_test.cpp LIBRARIES Boost::assert Boost::core) -boost_test(SOURCES exp/verify_exp_test.cpp LIBRARIES Boost::assert Boost::core) -boost_test(SOURCES exp/verify_msg_exp_test.cpp LIBRARIES Boost::assert Boost::core) - -boost_test(SOURCES assert_test2.cpp LIBRARIES Boost::assert Boost::core) -boost_test(SOURCES assert_msg_test2.cpp LIBRARIES Boost::assert Boost::core) - -boost_test(SOURCES quick.cpp LIBRARIES Boost::assert Boost::core) +# This one doesn't import +boost_test(TYPE run SOURCES current_function_test.cpp LIBRARIES Boost::assert Boost::core)