diff options
-rw-r--r-- | .ci.cmake | 48 | ||||
-rw-r--r-- | .travis.yml | 61 | ||||
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | Readme.md | 6 | ||||
-rw-r--r-- | appveyor.yml | 13 |
5 files changed, 123 insertions, 15 deletions
diff --git a/.ci.cmake b/.ci.cmake new file mode 100644 index 00000000..dc9e4b20 --- /dev/null +++ b/.ci.cmake @@ -0,0 +1,48 @@ +# CTest script for a CI to submit to CDash a run of configuration, +# building and testing +cmake_minimum_required(VERSION 3.0 FATAL_ERROR) +# Bring in the Boost lite cmake tooling +list(FIND CMAKE_MODULE_PATH "boost-lite" boost_lite_idx) +if(${boost_lite_idx} EQUAL -1) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../boost-lite/cmake") + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../boost-lite/cmake") + elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include/boost/outcome/boost-lite/cmake") + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/include/boost/outcome/boost-lite/cmake") + else() + message(FATAL_ERROR "FATAL: A copy of boost-lite cannot be found. Try running 'git submodule update --init --recursive'") + endif() +endif() +include(BoostLiteUtils) + + +configure_ctest_script_for_cdash("afio" "build") +ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + +ctest_start("Experimental") +ctest_configure() +ctest_build() +ctest_test() +merge_junit_results_into_ctest_xml() +if(WIN32) + execute_process(COMMAND "${CMAKE_COMMAND}" -E tar cfJ afio_v2_binaries_win64.tar.xz + doc + include + Readme.md + release_notes.md + build/lib/Release/afio_sl-2.0-Windows-x64-Release.lib + build/lib/Release/afio_dl-2.0-Windows-x64-Release.lib + build/bin/Release/afio_dl-2.0-Windows-x64-Release.dll + ) + ctest_upload(FILES afio_v2_binaries_win64.tar.xz) +else() + execute_process(COMMAND "${CMAKE_COMMAND}" -E tar cfJ afio_v2_binaries_linux64.tar.xz + doc + include + Readme.md + release_notes.md + build/lib/Release/afio_sl-2.0-Linux-x86_64-Release.a + build/bin/Release/afio_dl-2.0-Linux-x86_64-Release.so + ) + ctest_upload(FILES afio_v2_binaries_linux64.tar.xz) +endif() +#ctest_submit() diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..5edee756 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,61 @@ +language: cpp +sudo: false +os: + - linux +branches: + only: + - master +notifications: + email: + recipients: + - nialldouglas14@gmail.com + +addons: + apt: + sources: + - ubuntu-toolchain-r-test + - george-edison55-precise-backports +# - llvm-toolchain-precise-3.8 ## not currently working due to bad source signing key + packages: + - g++-6 + - python3 + - cmake + - cmake-data + +env: + - __="cmake tests" NAME=TravisLinuxWorker + +cache: + apt: true + directories: + - llvm-3.8.0 + +before_install: + - + LLVM_VERSION=3.8.0; + if [ "${TRAVIS_OS_NAME}" = "linux" ]; then + if [ -z "$(ls -A llvm-$LLVM_VERSION)" ]; then + wget -O llvm-$LLVM_VERSION.tar.xz http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-14.04.tar.xz; + mkdir llvm-$LLVM_VERSION; + xzcat llvm-$LLVM_VERSION.tar.xz | tar -xvf - --strip 1 -C llvm-$LLVM_VERSION; + cd llvm-$LLVM_VERSION/bin; + ln -s clang-3.8 clang++-3.8; + cd ../..; + fi; + llvm-$LLVM_VERSION/bin/llvm-config --version; + export LLVM_CONFIG="llvm-$LLVM_VERSION/bin/llvm-config"; + export PATH="$PWD/llvm-$LLVM_VERSION/bin:$PATH"; + fi + - git checkout master + - git submodule update --init --recursive + +script: + - + if [ "$__" = "cmake tests" ]; then + CXX=g++-6 ctest -S .ci.cmake -V; + fi + +after_success: +# - bash -x ./update_coveralls.sh `pwd` + +after_failure: diff --git a/CMakeLists.txt b/CMakeLists.txt index afa8328c..6d55c73f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,3 +76,13 @@ endif() # For all possible configurations of this library, add each test include(BoostLiteMakeStandardTests) +# For each test target, set compile options +if(MSVC) + foreach(test_target ${afio_TEST_TARGETS}) + target_compile_options(${test_target} PRIVATE /wd4503) ## decorated name length exceeded + endforeach() +endif() + +# Make available this library for install and export +include(BoostLiteMakeInstall) +include(BoostLiteMakeExport) @@ -8,17 +8,13 @@ v2 rewrite. You can view its documentation at https://ned14.github.io/boost.afio CMake todos: - Static library edition appears to not be encoding extended error code detail? - Add a unit test! -- CDash needs to display all the unit test results ideally - - ctest should combine the XML from the tests into a single XML - - ctest also needs to figure out if these binaries are using CATCH -- Make updating revision.hpp a non-default target and have the pre-commit git -hook call it Later: - Each test runner needs to be compiled into many sanitising build variants using the header only library - Also generate a DLL for each test kernel - Single include generation +- Make updating revision.hpp updated by the pre-commit git hook Notes on experimental automatic unit test framework: diff --git a/appveyor.yml b/appveyor.yml index 6c4bb8c7..c805e928 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,27 +20,20 @@ configuration: Release before_build: - git checkout master - git submodule update --init --recursive - - mkdir build build_script: - - cd build - - cmake .. - - cmake --build . --config Release + - ctest -S .ci.cmake -V after_build: - cd .. - - 7z a afio_v2_binaries_win64.zip doc include Readme.md release_notes.md build\bin\Release\afio_dl-2.0-Windows-Win32-Release.dll build\lib\Release\afio_sl-2.0-Windows-Win32-Release.lib + - 7z a afio_v2_binaries_win64.zip doc include Readme.md release_notes.md build\bin\Release\afio_dl-2.0-Windows-x64-Release.dll build\lib\Release\afio_dl-2.0-Windows-x64-Release.lib build\lib\Release\afio_sl-2.0-Windows-x64-Release.lib before_test: - - cd build test_script: - - ctest -D Experimental -C Release after_test: - - ..\include\boost\afio\boost-lite\scripts\merge_junit_results.py results.xml bin\Release\*.xml - - type results.xml on_success: on_failure: on_finish: - - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\results.xml)) + - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path build\merged_junit_results.xml)) artifacts: - path: afio_v2_binaries_win64.zip |