diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..125ef33 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,63 @@ +# Copyright 2020 Alexander Grund +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) + +name: Release + +on: + push: + branches: [master] + tags: ['v*'] + +jobs: + release: + name: Create Release + runs-on: ubuntu-latest + env: + BOOST_VERSION: 1.71.0 + BOOST_ROOT: ${{github.workspace}}/dependencies/boost + steps: + - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + with: + repository: boostorg/boost + ref: boost-${{env.BOOST_VERSION}} + path: ${{env.BOOST_ROOT}} + fetch-depth: 1 + - name: Prepare boost + working-directory: ${{env.BOOST_ROOT}} + run: | + git submodule update --init --jobs 3 tools/boostdep tools/quickbook tools/boostbook + python tools/boostdep/depinst/depinst.py --exclude test --git_args '--jobs 3' ../tools/quickbook + ./bootstrap.sh || (cat bootstrap.log && false) + - name: Install dependencies + run: sudo apt-get install xsltproc docbook-xsl docbook-xml + - name: Create documentation + run: scripts/build_doc.sh -j3 + - name: Package documentation + run: tar -czvf turtle_doc.tar.gz html + working-directory: doc + # This runs only when actual tags are created + - name: Create Release + if: startsWith(github.ref, 'refs/tags/') + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + C++ mock object library for Boost + draft: true + prerelease: false + - name: Upload docs + if: startsWith(github.ref, 'refs/tags/') + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: doc/turtle_doc.tar.gz + asset_name: turtle_doc.tar.gz + asset_content_type: application/tar.gz diff --git a/.gitignore b/.gitignore index 534e0e9..f094525 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .vscode bin out -build/xsl +/build __build diff --git a/.travis.yml b/.travis.yml index 2ce871f..a12eb45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,7 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # # Copyright Antony Polukhin 2014. - -# -# See https://svn.boost.org/trac/boost/wiki/TravisCoverals for description of this file -# and how it can be used with Boost libraries. -# +# Copyright Alexander Grund 2020. language: cpp @@ -49,10 +45,6 @@ before_install: - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 - gcc --version - # Set this to the name of your Boost library - # Autodetect library name by using the following code: - PROJECT_TO_TEST=$(basename $(pwd)) - - PROJECT_TO_TEST=$(basename $(pwd)) - # Files, which coverage results must be ignored (files from other projects). Example: - IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/path.cpp' - IGNORE_COVERAGE='*/boost-local/*' @@ -60,21 +52,21 @@ before_install: # Cloning Boost libraries (fast nondeep cloning) - PROJECT_DIR=`pwd` - git --version - - BOOST=$HOME/boost-local - - git clone -b $BRANCH_TO_TEST --depth 1 https://github.com/boostorg/boost.git $BOOST - - cd $BOOST + - BOOST_ROOT=$HOME/boost-local + - git clone -b $BRANCH_TO_TEST --depth 1 https://github.com/boostorg/boost.git $BOOST_ROOT + - cd $BOOST_ROOT - git submodule update --init --depth 1 - ./bootstrap.sh - ./b2 headers script: - cd $PROJECT_DIR - - export BOOST_ROOT=$BOOST + - export BOOST_ROOT # `--coverage` flags required to generate coverage info for Coveralls - - build/build.sh --toolset=$CC "cxxflags=-std=c++$CXX_STANDARD -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations --coverage" "linkflags=--coverage" -j3 + - scripts/build.sh --toolset=$CC "cxxflags=-std=c++$CXX_STANDARD -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations --coverage" "linkflags=--coverage" -j3 # CMake build - - cd $BOOST && ./b2 --with-test --with-thread --with-chrono --with-system --with-atomic --with-date_time -a -j3 # Build required libs - - mkdir $PROJECT_DIR/__build && cd $PROJECT_DIR/__build + - cd $BOOST_ROOT && ./b2 --with-test --with-thread --with-chrono --with-system --with-atomic --with-date_time -a -j3 # Build required libs + - mkdir $PROJECT_DIR/build && cd $PROJECT_DIR/build - cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-std=c++$CXX_STANDARD" - cmake --build . --config Debug -- -j3 - ctest --output-on-failure --build-config Debug diff --git a/CMakeLists.txt b/CMakeLists.txt index c372908..58b6828 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ endif() find_package(Boost 1.58 REQUIRED) set(MOCK_VERSION "\"${PROJECT_VERSION}\"") -configure_file(build/version.hpp ${CMAKE_CURRENT_BINARY_DIR}/include/turtle/version.hpp @ONLY) +configure_file(version.hpp.cmake ${CMAKE_CURRENT_BINARY_DIR}/include/turtle/version.hpp @ONLY) add_library(turtle INTERFACE) add_library(turtle::turtle ALIAS turtle) diff --git a/Jamfile.v2 b/Jamfile.v2 deleted file mode 100644 index a373100..0000000 --- a/Jamfile.v2 +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright Rene Rivera 2007. -# -# 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) - -# Usage: -# -# bjam [options | properties | targets] -# -# Options: -# -# --boost= The directory of a Boost source tree. -# Default; BOOST env var (if found) -# Default; ../boost (if found) -# -# --boost-build= -# The directory for the Boost.Build v2 files. -# Default; BOOST_BUILD_PATH env var (if found) -# Default; BOOST_BUILD env var (if found) -# Default; /tools/build/v2 (if found) - -#~ If we have the Boost sources we can use the project... - -if [ GLOB $(BOOST) : [ modules.peek project : JAMFILE ] ] -{ - use-project /boost : $(BOOST) ; -} diff --git a/Jamroot.jam b/Jamroot.jam index 8797198..df7f2f9 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -6,9 +6,11 @@ import modules ; -local boost = [ modules.peek : BOOST ] ; +if BOOST_ROOT +{ + local boost = [ modules.peek : BOOST_ROOT ] ; -project mock : requirements $(boost) . ; + project mock : requirements $(boost) ; -# This seems to prevent some Boost.Build errors that otherwise occur :-( -use-project /boost : $(boost) ; + #use-project /boost : $(boost) ; +} diff --git a/appveyor.yml b/appveyor.yml index 1ca3551..7ebd82e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -53,7 +53,7 @@ build_script: - cd %APPVEYOR_BUILD_FOLDER% - if NOT "%CXX_STANDARD%"=="" set CXX_FLAGS=cxxflags=/std:c++%CXX_STANDARD% - set BUILD_ARGS=address-model=32,64 variant=debug,release - - call build\build.bat --toolset=%TOOLSET% %CXX_FLAGS% -j3 + - call scripts\build.bat --toolset=%TOOLSET% %CXX_FLAGS% -j3 for: - matrix: @@ -62,8 +62,7 @@ for: build_script: - set BOOST_ROOT=C:\Libraries\boost_%BOOST% - cd %APPVEYOR_BUILD_FOLDER% - - mkdir __build - - cd __build + - mkdir build && cd build - cmake .. -DCMAKE_BUILD_TYPE=Debug - cmake --build . --config Debug - ctest --output-on-failure --build-config Debug diff --git a/build/build.bat b/build/build.bat deleted file mode 100644 index 261831c..0000000 --- a/build/build.bat +++ /dev/null @@ -1,30 +0,0 @@ -@echo off - -rem Copyright (C) 2015 Mathieu Champlon -rem -rem Distributed under the Boost Software License, Version 1.0. -rem (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - -setlocal - -rem error if BOOST_ROOT not set -set BOOST=%BOOST_ROOT% -set PROJECT_DIR=%cd% - -cd %BOOST% -b2.exe %PROJECT_DIR%\test -q %BUILD_ARGS% %* -if errorlevel 1 exit /b %ERRORLEVEL% - -cd %PROJECT_DIR% -set BOOSTBOOK_DIR=%PROJECT_DIR%\bin\turtle\boostbook -xcopy /Y /S /Q /I %BOOST%\tools\boostbook\xsl %BOOSTBOOK_DIR%\xsl -xcopy /Y /S /Q /I %BOOST%\tools\boostbook\dtd %BOOSTBOOK_DIR%\dtd -xcopy /Y /S /Q /I build\boostbook %BOOSTBOOK_DIR% -xcopy /Y /S /Q /I %BOOST%\doc\src\boostbook.css doc\html -xcopy /Y /S /Q /I %BOOST%\doc\src\images\*.png doc\html\images -xcopy /Y /S /Q /I %BOOST%\doc\src\images\callouts\*.png doc\html\images\callouts -if errorlevel 1 exit /b %ERRORLEVEL% - -cd %BOOST% -b2.exe %PROJECT_DIR%\doc -q %* -if errorlevel 1 exit /b %ERRORLEVEL% diff --git a/build/build.properties b/build/build.properties deleted file mode 100644 index 623180f..0000000 --- a/build/build.properties +++ /dev/null @@ -1 +0,0 @@ -extensions = headers,check,run diff --git a/build/build.sh b/build/build.sh deleted file mode 100755 index 33aa058..0000000 --- a/build/build.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2015 Mathieu Champlon -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - -copy() -{ - for dir; do true; done - mkdir -p "$dir" - cp "$@" -} - -set -eux - -export BOOST="$BOOST_ROOT" -PROJECT_DIR="$(pwd)" - -cd "$BOOST" -./b2 "$PROJECT_DIR/test" -q "$@" - -cd "$PROJECT_DIR" -export BOOSTBOOK_DIR="$PROJECT_DIR/bin/turtle/boostbook" -copy -r "$BOOST"/tools/boostbook/xsl "$BOOSTBOOK_DIR" -copy -r "$BOOST"/tools/boostbook/dtd "$BOOSTBOOK_DIR" -copy -r build/boostbook/* "$BOOSTBOOK_DIR" -copy "$BOOST"/doc/src/boostbook.css doc/html -copy "$BOOST"/doc/src/images/*.png doc/html/images -copy "$BOOST"/doc/src/images/callouts/*.png doc/html/images/callouts - -cd "$BOOST" -./b2 "$PROJECT_DIR/doc" -q "$@" diff --git a/build/build.xml b/build/build.xml deleted file mode 100644 index b2201f8..0000000 --- a/build/build.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/clang/Dockerfile b/build/clang/Dockerfile deleted file mode 100644 index fd3a65b..0000000 --- a/build/clang/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# $ docker build --platform=linux -f clang/Dockerfile -t turtle-clang . -FROM buildpack-deps:stretch -RUN apt-get update && apt-get install -y xsltproc docbook-xsl docbook-xml && apt-get autoremove && apt-get clean -ENV DOCBOOK_XSL_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl \ - DOCBOOK_DTD_DIR=/usr/share/xml/docbook/schema/dtd/4.2 \ - BOOST_ROOT=/home/dev/cpp/boost/ -# wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add - && \ -RUN echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main" >> /etc/apt/sources.list && \ - apt-get update && \ - apt-get install -y --allow-unauthenticated clang-5.0 lld-5.0 libc++1 && \ - apt-get autoremove && \ - apt-get clean && \ - update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 100 && \ - update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 100 -RUN echo 'cd /home/dev/cpp/turtle/build' >> ~/.bashrc -# $ docker run --platform=linux --rm -v C:/dev:/home/dev -m 32g -it turtle-clang -# ./build.sh --toolset=clang "cxxflags=-std=c++17 -stdlib=libc++ -Wno-unused-variable" diff --git a/build/gcc/Dockerfile b/build/gcc/Dockerfile deleted file mode 100644 index 5d1a4d8..0000000 --- a/build/gcc/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -# $ docker build -f Dockerfile -t turtle-gcc . -FROM gcc -RUN apt-get update && apt-get install -y xsltproc docbook-xsl docbook-xml && apt-get autoremove && apt-get clean -ENV DOCBOOK_XSL_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl \ - DOCBOOK_DTD_DIR=/usr/share/xml/docbook/schema/dtd/4.2 \ - BOOST_ROOT=/home/dev/cpp/boost/ -RUN echo 'cd /home/dev/cpp/turtle/build' >> ~/.bashrc -# $ docker run --platform=linux --rm -v C:/dev:/home/dev -m 16g -it turtle-gcc -# ./build.sh --toolset=gcc "cxxflags=-std=c++17 -Wno-noexcept-type -Wno-unused-variable -Wno-unused-function -Wno-deprecated-declarations" diff --git a/doc/Jamfile.jam b/doc/Jamfile.jam index bf5b54d..9800cf0 100644 --- a/doc/Jamfile.jam +++ b/doc/Jamfile.jam @@ -1,5 +1,3 @@ -# Boost.Mock -# # Copyright Mathieu Champlon 2012 # # Distributed under the Boost Software License version 1.0. (See @@ -46,7 +44,15 @@ project example rule compile-examples { - for name in [ glob example/*.cpp ] { compile $(name) ; } + local examples ; + for name in [ glob example/*.cpp ] + { + local compile-target = [ compile $(name) ] ; + explicit $(compile-target) ; + examples += $(compile-target) ; + } + return $(examples) ; } alias mock_examples : [ compile-examples ] ; +explicit mock_examples ; diff --git a/build/boostbook/xsl/navbar.xsl b/doc/boostbook/xsl/navbar.xsl similarity index 100% rename from build/boostbook/xsl/navbar.xsl rename to doc/boostbook/xsl/navbar.xsl diff --git a/doc/mock.qbk b/doc/mock.qbk index 7cdd860..4915d9b 100644 --- a/doc/mock.qbk +++ b/doc/mock.qbk @@ -7,8 +7,7 @@ [article Turtle [quickbook 1.5] -[/ [authors [Champlon, Mathieu]] ] - [authors [,A C++ mock object library for Boost]] + [authors [Champlon, Mathieu]] [copyright 2008-2014 Mathieu Champlon] [license Distributed under the [@http://www.boost.org/LICENSE_1_0.txt Boost Software License, Version 1.0]. @@ -16,8 +15,6 @@ [/ [purpose A C++ mock object library for Boost] ] ] -[note Turtle is not an official Boost library.] - [/ [section:introduction Introduction] diff --git a/index.html b/index.html index cfecfa2..fa5974d 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ Automatic redirection failed, please go to doc/html/index.html
-Boost.Mock
+Turtle

Copyright Mathieu Champlon 2012

diff --git a/scripts/build.bat b/scripts/build.bat new file mode 100644 index 0000000..98dda03 --- /dev/null +++ b/scripts/build.bat @@ -0,0 +1,30 @@ +@echo off + +rem Copyright (C) 2015 Mathieu Champlon +rem +rem Distributed under the Boost Software License, Version 1.0. +rem (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + +setlocal + +rem Need to set BOOST_ROOT and run from the source root directory + +set PROJECT_DIR=%cd% + +cd %BOOST_ROOT% +b2.exe %PROJECT_DIR%\test -q %BUILD_ARGS% %* +if errorlevel 1 exit /b %ERRORLEVEL% + +cd %PROJECT_DIR% +set BOOSTBOOK_DIR=%PROJECT_DIR%\bin\turtle\boostbook +xcopy /Y /S /Q /I %BOOST_ROOT%\tools\boostbook\xsl %BOOSTBOOK_DIR%\xsl +xcopy /Y /S /Q /I %BOOST_ROOT%\tools\boostbook\dtd %BOOSTBOOK_DIR%\dtd +xcopy /Y /S /Q /I doc\boostbook %BOOSTBOOK_DIR% +xcopy /Y /S /Q /I %BOOST_ROOT%\doc\src\boostbook.css doc\html +xcopy /Y /S /Q /I %BOOST_ROOT%\doc\src\images\*.png doc\html\images +xcopy /Y /S /Q /I %BOOST_ROOT%\doc\src\images\callouts\*.png doc\html\images\callouts +if errorlevel 1 exit /b %ERRORLEVEL% + +cd %BOOST_ROOT% +b2.exe %PROJECT_DIR%\doc -q %* +if errorlevel 1 exit /b %ERRORLEVEL% diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..3261c23 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# Copyright (C) 2015 Mathieu Champlon +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + +set -eux + +# Need to set BOOST_ROOT and run from the source root directory +PROJECT_DIR="$(pwd)" + +cd "$BOOST_ROOT" +./b2 "$PROJECT_DIR/test" -q "$@" + +cd "$PROJECT_DIR" +scripts/build_doc.sh "$@" + +cd "$BOOST_ROOT" +./b2 "$PROJECT_DIR/doc//mock_examples" -q "$@" diff --git a/scripts/build_doc.sh b/scripts/build_doc.sh new file mode 100755 index 0000000..42af832 --- /dev/null +++ b/scripts/build_doc.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Copyright (C) 2015 Mathieu Champlon +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + +# Execute from repo root folder or set PROJECT_DIR +# Requires BOOST_ROOT to be set + +set -eu + +copy() +{ + for dir; do true; done + mkdir -p "$dir" + cp "$@" +} + +PROJECT_DIR="${PROJECT_DIR:-$(pwd)}" + +export BOOSTBOOK_DIR="${PROJECT_DIR}/bin/turtle/boostbook" +copy -r "$BOOST_ROOT"/tools/boostbook/xsl "$BOOSTBOOK_DIR" +copy -r "$BOOST_ROOT"/tools/boostbook/dtd "$BOOSTBOOK_DIR" +copy -r doc/boostbook/* "$BOOSTBOOK_DIR" +copy "$BOOST_ROOT"/doc/src/boostbook.css doc/html +copy "$BOOST_ROOT"/doc/src/images/*.png doc/html/images +copy "$BOOST_ROOT"/doc/src/images/callouts/*.png doc/html/images/callouts + +cd "$BOOST_ROOT" +./b2 "$PROJECT_DIR/doc" -q "$@" diff --git a/test/Jamfile.jam b/test/Jamfile.jam index 7b7cd14..39852e3 100644 --- a/test/Jamfile.jam +++ b/test/Jamfile.jam @@ -1,5 +1,3 @@ -# Boost.Mock -# # Copyright Mathieu Champlon 2012 # # Distributed under the Boost Software License version 1.0. (See diff --git a/build/version.hpp b/version.hpp.cmake similarity index 83% rename from build/version.hpp rename to version.hpp.cmake index 2dfeecc..d9c8a24 100644 --- a/build/version.hpp +++ b/version.hpp.cmake @@ -7,3 +7,4 @@ // http://www.boost.org/LICENSE_1_0.txt) #define MOCK_VERSION @MOCK_VERSION@ +#define TURTLE_VERSION "@turtle_VERSION@"