From b7f07b2f55c05fc3603feb1cd7c4814d648f11d4 Mon Sep 17 00:00:00 2001 From: Gabriele Contini <contini.mailing@gmail.com> Date: 周六, 30 11月 2019 18:48:45 +0800 Subject: [PATCH] fix centos tests --- scripts/windows_download_boost.bat | 0 test/functional/generate-license.cpp | 1 + .travis.yml | 10 ++++++---- CMakeLists.txt | 6 ++---- src/library/os/CMakeLists.txt | 2 -- test/CMakeLists.txt | 1 - 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 773c9be..aea5a1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,6 +84,9 @@ - os: linux dist: bionic name: "Ubuntu 18.04 - MinGW cross-compile for Windows x64" + env: + - CTEST_OUTPUT_ON_FAILURE=1 + - WINEARCH=win64 addons: apt: packages: @@ -107,14 +110,14 @@ - os: windows name: "Widnows server 1803 - Visual Studio 15 2017 Win64 - (/MD)" before_script: - - travis_wait 40 ./windows_download_boost.bat + - travis_wait 40 ./scripts/windows_download_boost.bat - cd "${TRAVIS_BUILD_DIR}/build" - cmake -G "Visual Studio 15 2017 Win64" -DBOOST_ROOT="C:/local/boost" .. - os: windows name: "Widnows server 1803 - Visual Studio 15 2017 Win64 - (/MT)" before_script: - - travis_wait 40 ./windows_download_boost.bat + - travis_wait 40 ./scripts/windows_download_boost.bat - cd "${TRAVIS_BUILD_DIR}" - cd build && cmake -G "Visual Studio 15 2017 Win64" -DBOOST_ROOT="C:/local/boost" -DSTATIC_RUNTIME=1 .. @@ -147,11 +150,10 @@ env: - CTEST_OUTPUT_ON_FAILURE=1 - before_script: - cd build && cmake -DCMAKE_INSTALL_PREFIX=../../install .. script: - cmake --build . --target install --config Release - ctest -C Release - + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a5ccea..e24dcfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,7 @@ message( STATUS "Project name : " ${LCC_PROJECT_NAME} ) message( STATUS "Project base dir : " ${LCC_PROJECTS_BASE_DIR}/${LCC_PROJECT_NAME} ) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include) add_subdirectory(src) #boost is required only for tests @@ -133,7 +134,7 @@ message(STATUS "Compiler architecture: ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}") endif() SET( Boost_USE_STATIC_LIBS ON ) -find_package(Boost REQUIRED COMPONENTS unit_test_framework system filesystem) +find_package(Boost COMPONENTS unit_test_framework system filesystem) #if boost is found enable tests IF(Boost_FOUND) @@ -146,6 +147,3 @@ ELSE(Boost_FOUND) message(WARNING "Boost not found, disabling tests") ENDIF(Boost_FOUND) - -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include) - \ No newline at end of file diff --git a/windows_download_boost.bat b/scripts/windows_download_boost.bat similarity index 100% rename from windows_download_boost.bat rename to scripts/windows_download_boost.bat diff --git a/src/library/os/CMakeLists.txt b/src/library/os/CMakeLists.txt index b5aaabe..fc525b4 100644 --- a/src/library/os/CMakeLists.txt +++ b/src/library/os/CMakeLists.txt @@ -26,6 +26,4 @@ ) ENDIF(UNIX) - - install(TARGETS os ARCHIVE DESTINATION lib/${PROJECT_NAME}/${LCC_PROJECT_NAME}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c1be16e..2c02526 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,7 +9,6 @@ "${CMAKE_BINARY_DIR}/licensecc_properties_test.h.tmp" ) -cmake_policy(SET CMP0070 NEW) file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/include/$<CONFIG>/licensecc_properties_test.h" INPUT "${CMAKE_BINARY_DIR}/licensecc_properties_test.h.tmp") diff --git a/test/functional/generate-license.cpp b/test/functional/generate-license.cpp index febf621..0002bee 100644 --- a/test/functional/generate-license.cpp +++ b/test/functional/generate-license.cpp @@ -8,6 +8,7 @@ #include <boost/test/unit_test.hpp> #include <boost/filesystem.hpp> #include <sstream> +#include <fstream> #include <iostream> #include <licensecc_properties_test.h> -- Gitblit v1.9.1