diff --git a/.appveyor.yml b/.appveyor.yml index b3272fe..2130e34 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,34 +7,17 @@ platform: - x64 configuration: - - Debug - Release for: -- - matrix: - only: - - platform: x86 - configuration: Debug - build_script: - - scripts\build_debug_x86.bat - -- - matrix: - only: - - platform: x64 - configuration: Debug - build_script: - - scripts\build_debug_x64.bat - - matrix: only: - platform: x86 configuration: Release build_script: - - scripts\build_release_x86.bat + - .ci\build_windows_x86.bat - matrix: @@ -42,4 +25,4 @@ for: - platform: x64 configuration: Release build_script: - - scripts\build_release_x64.bat + - .ci\build_windows_x64.bat diff --git a/.ci/build_coverage.sh b/.ci/build_coverage.sh new file mode 100755 index 0000000..7c8a1aa --- /dev/null +++ b/.ci/build_coverage.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" + +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/coverage" + +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_COVERAGE=ON) +(cd "${BUILD_DIR}" && cmake --build .) + +(cd "${BUILD_DIR}" && lcov -d . -z) +(cd "${BUILD_DIR}" && ctest --verbose) + +(cd "${BUILD_DIR}" && lcov -d . -c -o "coverage.info") +(cd "${BUILD_DIR}" && lcov -r "coverage.info" "*/usr/*" "*/untests/*" -o "coverage.info") +(cd "${BUILD_DIR}" && lcov -l "coverage.info") + +bash <(curl -s https://codecov.io/bash) -f "${BUILD_DIR}/coverage.info" || echo "Codecov did not collect coverage reports" diff --git a/.ci/build_darwin.sh b/.ci/build_darwin.sh new file mode 100755 index 0000000..658e0c1 --- /dev/null +++ b/.ci/build_darwin.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" + +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/darwin_release" + +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release) +(cd "${BUILD_DIR}" && cmake --build .) +(cd "${BUILD_DIR}" && ctest --verbose) diff --git a/.ci/build_linux.sh b/.ci/build_linux.sh new file mode 100755 index 0000000..c622bc4 --- /dev/null +++ b/.ci/build_linux.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" + +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/linux_release" + +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release) +(cd "${BUILD_DIR}" && cmake --build .) +(cd "${BUILD_DIR}" && ctest --verbose) diff --git a/.ci/build_windows_x64.bat b/.ci/build_windows_x64.bat new file mode 100644 index 0000000..0fff1e8 --- /dev/null +++ b/.ci/build_windows_x64.bat @@ -0,0 +1,19 @@ +@echo off +set DIR=%~dp0 + +set ROOT_DIR=%DIR%..\ +set BUILD_DIR=%ROOT_DIR%build\windows_release_x64\ + +if not exist %BUILD_DIR% mkdir %BUILD_DIR% || goto :error + +pushd %BUILD_DIR% || goto :error +cmake %ROOT_DIR% -A x64 || goto :error +cmake --build . --config Release || goto :error +ctest --verbose || goto :error +popd || goto :error + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% diff --git a/.ci/build_windows_x86.bat b/.ci/build_windows_x86.bat new file mode 100644 index 0000000..58f0a9f --- /dev/null +++ b/.ci/build_windows_x86.bat @@ -0,0 +1,19 @@ +@echo off +set DIR=%~dp0 + +set ROOT_DIR=%DIR%..\ +set BUILD_DIR=%ROOT_DIR%build\windows_release_x86\ + +if not exist %BUILD_DIR% mkdir %BUILD_DIR% || goto :error + +pushd %BUILD_DIR% || goto :error +cmake %ROOT_DIR% -A Win32 || goto :error +cmake --build . --config Release || goto :error +ctest --verbose || goto :error +popd || goto :error + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% diff --git a/.travis.yml b/.travis.yml index ebd9eac..49a377d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,116 +8,60 @@ jobs: include: # - # linux (g++-7) + # linux (g++) # - os: linux - dist: xenial + dist: bionic stage: linux - name: debug, g++-7 + name: g++-7 addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7"] } } env: CC=gcc-7 CXX=g++-7 - script: ./scripts/build_debug.sh + script: .ci/build_linux.sh - os: linux - dist: xenial + dist: bionic stage: linux - name: release, g++-7 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7"] } } - env: CC=gcc-7 CXX=g++-7 - script: ./scripts/build_release.sh - - # - # linux (g++-8) - # - - - os: linux - dist: xenial - stage: linux - name: debug, g++-8 + name: g++-8 addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-8"] } } env: CC=gcc-8 CXX=g++-8 - script: ./scripts/build_debug.sh - - - os: linux - dist: xenial - stage: linux - name: release, g++-8 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-8"] } } - env: CC=gcc-8 CXX=g++-8 - script: ./scripts/build_release.sh + script: .ci/build_linux.sh # - # linux (clang++-5.0) + # linux (clang++) # - os: linux - dist: xenial + dist: bionic stage: linux - name: debug, clang++-5.0 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7", "clang-5.0"] } } + name: clang++-5.0 + addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["clang-5.0"] } } env: CC=clang-5.0 CXX=clang++-5.0 - script: ./scripts/build_debug.sh + script: .ci/build_linux.sh - os: linux - dist: xenial + dist: bionic stage: linux - name: release, clang++-5.0 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7", "clang-5.0"] } } - env: CC=clang-5.0 CXX=clang++-5.0 - script: ./scripts/build_release.sh - - # - # linux (clang++-6.0) - # - - - os: linux - dist: xenial - stage: linux - name: debug, clang++-6.0 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7", "clang-6.0"] } } + name: clang++-6.0 + addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["clang-6.0"] } } env: CC=clang-6.0 CXX=clang++-6.0 - script: ./scripts/build_debug.sh - - - os: linux - dist: xenial - stage: linux - name: release, clang++-6.0 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7", "clang-6.0"] } } - env: CC=clang-6.0 CXX=clang++-6.0 - script: ./scripts/build_release.sh + script: .ci/build_linux.sh # - # macosx (xcode10) + # darwin # - os: osx osx_image: xcode10 - stage: macosx - name: debug, xcode10 - script: ./scripts/build_debug.sh - - - os: osx - osx_image: xcode10 - stage: macosx - name: release, xcode10 - script: ./scripts/build_release.sh - - # - # macosx (xcode11) - # + stage: darwin + name: xcode10 + script: .ci/build_darwin.sh - os: osx osx_image: xcode11 - stage: macosx - name: debug, xcode11 - script: ./scripts/build_debug.sh - - - os: osx - osx_image: xcode11 - stage: macosx - name: release, xcode11 - script: ./scripts/build_release.sh + stage: darwin + name: xcode11 + script: .ci/build_darwin.sh # # coverage @@ -126,6 +70,6 @@ jobs: - os: osx osx_image: xcode10 stage: coverage - name: coverage, xcode10 + name: coverage addons: { homebrew: { packages: ["lcov"], update: true } } - script: ./scripts/upload_coverage.sh + script: .ci/build_coverage.sh diff --git a/LICENSE.md b/LICENSE.md index d8d62a8..1c580c4 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2017-2020, by Matvey Cherevko (blackmatov@gmail.com) +Copyright (C) 2017-2021, by Matvey Cherevko (blackmatov@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/headers/kari.hpp/kari.hpp b/headers/kari.hpp/kari.hpp index fc7da9f..b163580 100644 --- a/headers/kari.hpp/kari.hpp +++ b/headers/kari.hpp/kari.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/BlackMATov/kari.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2017-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2017-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/scripts/build_all.bat b/scripts/build_all.bat deleted file mode 100644 index 9e778dc..0000000 --- a/scripts/build_all.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -set SCRIPT_DIR=%~dp0% -call %SCRIPT_DIR%\build_debug_x86.bat || goto :error -call %SCRIPT_DIR%\build_debug_x64.bat || goto :error -call %SCRIPT_DIR%\build_release_x86.bat || goto :error -call %SCRIPT_DIR%\build_release_x64.bat || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/build_all.sh b/scripts/build_all.sh deleted file mode 100755 index d9cd585..0000000 --- a/scripts/build_all.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -e -SCRIPT_DIR=`dirname "$BASH_SOURCE"` -$SCRIPT_DIR/build_debug.sh -$SCRIPT_DIR/build_release.sh diff --git a/scripts/build_clear.bat b/scripts/build_clear.bat deleted file mode 100644 index 44375fb..0000000 --- a/scripts/build_clear.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -set BUILD_DIR=%~dp0%\..\build -rmdir /s /q %BUILD_DIR% || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/build_clear.sh b/scripts/build_clear.sh deleted file mode 100755 index ef8a2e3..0000000 --- a/scripts/build_clear.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build -rm -rf $BUILD_DIR diff --git a/scripts/build_debug.sh b/scripts/build_debug.sh deleted file mode 100755 index a069095..0000000 --- a/scripts/build_debug.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build -mkdir -p $BUILD_DIR/Debug -pushd $BUILD_DIR/Debug -cmake -DCMAKE_BUILD_TYPE=Debug ../.. -cmake --build . -ctest --verbose -popd diff --git a/scripts/build_debug_x64.bat b/scripts/build_debug_x64.bat deleted file mode 100644 index f80c2f3..0000000 --- a/scripts/build_debug_x64.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -set BUILD_DIR=%~dp0%\..\build -mkdir %BUILD_DIR%\Debug\x64 || goto :error -pushd %BUILD_DIR%\Debug\x64 || goto :error -cmake ..\..\.. -A x64 || goto :error -cmake --build . --config Debug || goto :error -ctest --verbose || goto :error -popd || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/build_debug_x86.bat b/scripts/build_debug_x86.bat deleted file mode 100644 index ee05129..0000000 --- a/scripts/build_debug_x86.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -set BUILD_DIR=%~dp0%\..\build -mkdir %BUILD_DIR%\Debug\x86 || goto :error -pushd %BUILD_DIR%\Debug\x86 || goto :error -cmake ..\..\.. -A Win32 || goto :error -cmake --build . --config Debug || goto :error -ctest --verbose || goto :error -popd || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/build_release.sh b/scripts/build_release.sh deleted file mode 100755 index 1377504..0000000 --- a/scripts/build_release.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build -mkdir -p $BUILD_DIR/Release -pushd $BUILD_DIR/Release -cmake -DCMAKE_BUILD_TYPE=Release ../.. -cmake --build . -ctest --verbose -popd diff --git a/scripts/build_release_x64.bat b/scripts/build_release_x64.bat deleted file mode 100644 index 65e251e..0000000 --- a/scripts/build_release_x64.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -set BUILD_DIR=%~dp0%\..\build -mkdir %BUILD_DIR%\Release\x64 || goto :error -pushd %BUILD_DIR%\Release\x64 || goto :error -cmake ..\..\.. -A x64 || goto :error -cmake --build . --config Release || goto :error -ctest --verbose || goto :error -popd || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/build_release_x86.bat b/scripts/build_release_x86.bat deleted file mode 100644 index 1be857b..0000000 --- a/scripts/build_release_x86.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -set BUILD_DIR=%~dp0%\..\build -mkdir %BUILD_DIR%\Release\x86 || goto :error -pushd %BUILD_DIR%\Release\x86 || goto :error -cmake ..\..\.. -A Win32 || goto :error -cmake --build . --config Release || goto :error -ctest --verbose || goto :error -popd || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/upload_coverage.sh b/scripts/upload_coverage.sh deleted file mode 100755 index d2def85..0000000 --- a/scripts/upload_coverage.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -e - -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build -mkdir -p $BUILD_DIR/coverage -cd $BUILD_DIR/coverage -cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_COVERAGE=ON ../.. -cmake --build . - -lcov -d . -z -ctest --verbose - -lcov -d . -c -o "coverage.info" -lcov -r "coverage.info" "*/usr/*" "*/untests/*" -o "coverage.info" -lcov -l "coverage.info" - -bash <(curl -s https://codecov.io/bash) -f "coverage.info" || echo "Codecov did not collect coverage reports" diff --git a/untests/kari_examples.cpp b/untests/kari_examples.cpp index a8a974d..cc5e9d0 100644 --- a/untests/kari_examples.cpp +++ b/untests/kari_examples.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/BlackMATov/kari.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2017-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2017-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include diff --git a/untests/kari_ext_tests.cpp b/untests/kari_ext_tests.cpp index a805fe0..deb2027 100644 --- a/untests/kari_ext_tests.cpp +++ b/untests/kari_ext_tests.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/BlackMATov/kari.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2017-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2017-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include diff --git a/untests/kari_tests.cpp b/untests/kari_tests.cpp index f291550..a1d2c0c 100644 --- a/untests/kari_tests.cpp +++ b/untests/kari_tests.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/BlackMATov/kari.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2017-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2017-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include