diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..aa2e1df --- /dev/null +++ b/.travis.yml @@ -0,0 +1,327 @@ +# Copyright 2016, 2017 Peter Dimov +# 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) + +language: cpp + +sudo: false + +python: "2.7" + +os: + - linux + - osx + +branches: + only: + - master + - develop + +env: + matrix: + - BOGUS_JOB=true + +matrix: + + exclude: + - env: BOGUS_JOB=true + + include: + - os: linux + env: TOOLSET=gcc COMPILER=g++ CXXSTD=c++03 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++03 + addons: + apt: + packages: + - g++-4.7 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++11 + addons: + apt: + packages: + - g++-4.7 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++03 + addons: + apt: + packages: + - g++-4.8 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++11 + addons: + apt: + packages: + - g++-4.8 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++03 + addons: + apt: + packages: + - g++-4.9 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++11 + addons: + apt: + packages: + - g++-4.9 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++03 + addons: + apt: + packages: + - g++-5 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++11 + addons: + apt: + packages: + - g++-5 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 + addons: + apt: + packages: + - g++-5 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03 + addons: + apt: + packages: + - g++-6 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11 + addons: + apt: + packages: + - g++-6 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14 + addons: + apt: + packages: + - g++-6 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z + addons: + apt: + packages: + - g++-6 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03 + + - os: linux + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++03 + addons: + apt: + packages: + - clang-3.5 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.5 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++11 + addons: + apt: + packages: + - clang-3.5 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.5 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++03 + addons: + apt: + packages: + - clang-3.6 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.6 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++11 + addons: + apt: + packages: + - clang-3.6 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.6 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++03 + addons: + apt: + packages: + - clang-3.7 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.7 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++11 + addons: + apt: + packages: + - clang-3.7 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.7 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++03 + addons: + apt: + packages: + - clang-3.8 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++11 + addons: + apt: + packages: + - clang-3.8 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++14 + addons: + apt: + packages: + - clang-3.8 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++1z + addons: + apt: + packages: + - clang-3.8 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++03 + addons: + apt: + packages: + - clang-3.9 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.9 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++11 + addons: + apt: + packages: + - clang-3.9 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.9 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++14 + addons: + apt: + packages: + - clang-3.9 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.9 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++1z + addons: + apt: + packages: + - clang-3.9 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.9 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z + +install: + - cd .. + - git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + - cd boost-root + - git submodule update --init tools/build + - git submodule update --init libs/config + - git submodule update --init tools/boostdep + - cp -r $TRAVIS_BUILD_DIR/* libs/static_assert + - python tools/boostdep/depinst/depinst.py static_assert + - ./bootstrap.sh + - ./b2 headers + +script: + - |- + echo "using $TOOLSET : : $COMPILER : -std=$CXXSTD ;" > ~/user-config.jam + - ./b2 libs/static_assert/test toolset=$TOOLSET + +notifications: + email: + on_success: always diff --git a/Jamfile.v2 b/Jamfile.v2 index 14dfe2f..7c0a96b 100644 --- a/Jamfile.v2 +++ b/Jamfile.v2 @@ -6,26 +6,4 @@ # bring in the rules for testing import testing ; -test-suite static_assert : - [ run static_assert_test.cpp ] -# [ run static_assert_example_1.cpp ] - [ run static_assert_example_2.cpp ] - [ run static_assert_example_3.cpp ] - [ compile-fail static_assert_test_fail_1.cpp ] - [ compile-fail static_assert_test_fail_2.cpp ] - [ compile-fail static_assert_test_fail_3.cpp ] - [ compile-fail static_assert_test_fail_4.cpp ] - [ compile-fail static_assert_test_fail_5.cpp ] - [ compile-fail static_assert_test_fail_6.cpp ] - [ compile-fail static_assert_test_fail_7.cpp ] - [ compile-fail static_assert_test_fail_8.cpp ] - [ compile-fail static_assert_test_fail_9.cpp ] - [ compile-fail static_assert_test_fail_10.cpp ] -; - - - - - - - +build-project test ; \ No newline at end of file diff --git a/doc/static_assert.qbk b/doc/static_assert.qbk index 2fab4d9..643591a 100644 --- a/doc/static_assert.qbk +++ b/doc/static_assert.qbk @@ -222,19 +222,19 @@ working at namespace, function, and class scope outweighed the ugliness of a mac [table Test programs provided with static_assert [[Test Program][Expected to Compile][Description]] -[[[@../../libs/static_assert/static_assert_test.cpp static_assert_test.cpp]] [Yes] [Illustrates usage, and should always compile, really just tests compiler compatibility.]] -[[[@../../libs/static_assert/static_assert_example_1.cpp static_assert_example_1.cpp]] [Platform dependent.] [Namespace scope test program, may compile depending upon the platform. ]] -[[[@../../libs/static_assert/static_assert_example_2.cpp static_assert_example_2.cpp]] [Yes] [Function scope test program. ]] -[[[@../../libs/static_assert/static_assert_example_3.cpp static_assert_example_3.cpp]] [Yes] [Class scope test program. ]] -[[[@../../libs/static_assert/static_assert_test_fail_1.cpp static_assert_test_fail_1.cpp]] [No] [Illustrates failure at namespace scope. ]] -[[[@../../libs/static_assert/static_assert_test_fail_2.cpp static_assert_test_fail_2.cpp]] [No] [Illustrates failure at non-template function scope. ]] -[[[@../../libs/static_assert/static_assert_test_fail_3.cpp static_assert_test_fail_3.cpp]] [No] [Illustrates failure at non-template class scope. ]] -[[[@../../libs/static_assert/static_assert_test_fail_4.cpp static_assert_test_fail_4.cpp]] [No] [Illustrates failure at non-template class scope. ]] -[[[@../../libs/static_assert/static_assert_test_fail_5.cpp static_assert_test_fail_5.cpp]] [No] [Illustrates failure at template class scope. ]] -[[[@../../libs/static_assert/static_assert_test_fail_6.cpp static_assert_test_fail_6.cpp]] [No] [Illustrates failure at template class member function scope. ]] -[[[@../../libs/static_assert/static_assert_test_fail_7.cpp static_assert_test_fail_7.cpp]] [No] [Illustrates failure of class scope example. ]] -[[[@../../libs/static_assert/static_assert_test_fail_8.cpp static_assert_test_fail_8.cpp]] [No] [Illustrates failure of function scope example. ]] -[[[@../../libs/static_assert/static_assert_test_fail_9.cpp static_assert_test_fail_9.cpp]] [No] [Illustrates failure of function scope example (part 2). ]] +[[[@../../libs/static_assert/example/static_assert_example_1.cpp static_assert_example_1.cpp]] [Platform dependent.] [Namespace scope test program, may compile depending upon the platform. ]] +[[[@../../libs/static_assert/example/static_assert_example_2.cpp static_assert_example_2.cpp]] [Yes] [Function scope test program. ]] +[[[@../../libs/static_assert/example/static_assert_example_3.cpp static_assert_example_3.cpp]] [Yes] [Class scope test program. ]] +[[[@../../libs/static_assert/test/static_assert_test.cpp static_assert_test.cpp]] [Yes] [Illustrates usage, and should always compile, really just tests compiler compatibility.]] +[[[@../../libs/static_assert/test/static_assert_test_fail_1.cpp static_assert_test_fail_1.cpp]] [No] [Illustrates failure at namespace scope. ]] +[[[@../../libs/static_assert/test/static_assert_test_fail_2.cpp static_assert_test_fail_2.cpp]] [No] [Illustrates failure at non-template function scope. ]] +[[[@../../libs/static_assert/test/static_assert_test_fail_3.cpp static_assert_test_fail_3.cpp]] [No] [Illustrates failure at non-template class scope. ]] +[[[@../../libs/static_assert/test/static_assert_test_fail_4.cpp static_assert_test_fail_4.cpp]] [No] [Illustrates failure at non-template class scope. ]] +[[[@../../libs/static_assert/test/static_assert_test_fail_5.cpp static_assert_test_fail_5.cpp]] [No] [Illustrates failure at template class scope. ]] +[[[@../../libs/static_assert/test/static_assert_test_fail_6.cpp static_assert_test_fail_6.cpp]] [No] [Illustrates failure at template class member function scope. ]] +[[[@../../libs/static_assert/test/static_assert_test_fail_7.cpp static_assert_test_fail_7.cpp]] [No] [Illustrates failure of class scope example. ]] +[[[@../../libs/static_assert/test/static_assert_test_fail_8.cpp static_assert_test_fail_8.cpp]] [No] [Illustrates failure of function scope example. ]] +[[[@../../libs/static_assert/test/static_assert_test_fail_9.cpp static_assert_test_fail_9.cpp]] [No] [Illustrates failure of function scope example (part 2). ]] ] diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 new file mode 100644 index 0000000..0f3c356 --- /dev/null +++ b/example/Jamfile.v2 @@ -0,0 +1,20 @@ +# copyright John Maddock 2003 +# Use, modification and distribution are subject to 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) + +# bring in the rules for testing +import testing ; + +test-suite static_assert : +# [ run static_assert_example_1.cpp ] + [ run static_assert_example_2.cpp ] + [ run static_assert_example_3.cpp ] +; + + + + + + + diff --git a/static_assert_example_1.cpp b/example/static_assert_example_1.cpp similarity index 100% rename from static_assert_example_1.cpp rename to example/static_assert_example_1.cpp diff --git a/static_assert_example_2.cpp b/example/static_assert_example_2.cpp similarity index 100% rename from static_assert_example_2.cpp rename to example/static_assert_example_2.cpp index a32b79d..38a284b 100644 --- a/static_assert_example_2.cpp +++ b/example/static_assert_example_2.cpp @@ -5,11 +5,11 @@ // See http://www.boost.org for most recent version including documentation. +#include +#include #include #include #include -#include -#include template RandomAccessIterator foo(RandomAccessIterator from, RandomAccessIterator /*to*/) diff --git a/static_assert_example_3.cpp b/example/static_assert_example_3.cpp similarity index 100% rename from static_assert_example_3.cpp rename to example/static_assert_example_3.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 new file mode 100644 index 0000000..acb28e7 --- /dev/null +++ b/test/Jamfile.v2 @@ -0,0 +1,30 @@ +# copyright John Maddock 2003 +# Use, modification and distribution are subject to 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) + +# bring in the rules for testing +import testing ; + +test-suite static_assert : + [ run static_assert_test.cpp ] + [ compile-fail static_assert_test_fail_1.cpp ] + [ compile-fail static_assert_test_fail_2.cpp ] + [ compile-fail static_assert_test_fail_3.cpp ] + [ compile-fail static_assert_test_fail_4.cpp ] + [ compile-fail static_assert_test_fail_5.cpp ] + [ compile-fail static_assert_test_fail_6.cpp ] + [ compile-fail static_assert_test_fail_7.cpp ] + [ compile-fail static_assert_test_fail_8.cpp ] + [ compile-fail static_assert_test_fail_9.cpp ] + [ compile-fail static_assert_test_fail_10.cpp ] +; + +build-project ../example ; + + + + + + + diff --git a/static_assert_test.cpp b/test/static_assert_test.cpp similarity index 100% rename from static_assert_test.cpp rename to test/static_assert_test.cpp diff --git a/static_assert_test_fail_1.cpp b/test/static_assert_test_fail_1.cpp similarity index 100% rename from static_assert_test_fail_1.cpp rename to test/static_assert_test_fail_1.cpp diff --git a/static_assert_test_fail_10.cpp b/test/static_assert_test_fail_10.cpp similarity index 100% rename from static_assert_test_fail_10.cpp rename to test/static_assert_test_fail_10.cpp diff --git a/static_assert_test_fail_2.cpp b/test/static_assert_test_fail_2.cpp similarity index 100% rename from static_assert_test_fail_2.cpp rename to test/static_assert_test_fail_2.cpp diff --git a/static_assert_test_fail_3.cpp b/test/static_assert_test_fail_3.cpp similarity index 100% rename from static_assert_test_fail_3.cpp rename to test/static_assert_test_fail_3.cpp diff --git a/static_assert_test_fail_4.cpp b/test/static_assert_test_fail_4.cpp similarity index 100% rename from static_assert_test_fail_4.cpp rename to test/static_assert_test_fail_4.cpp diff --git a/static_assert_test_fail_5.cpp b/test/static_assert_test_fail_5.cpp similarity index 100% rename from static_assert_test_fail_5.cpp rename to test/static_assert_test_fail_5.cpp diff --git a/static_assert_test_fail_6.cpp b/test/static_assert_test_fail_6.cpp similarity index 100% rename from static_assert_test_fail_6.cpp rename to test/static_assert_test_fail_6.cpp diff --git a/static_assert_test_fail_7.cpp b/test/static_assert_test_fail_7.cpp similarity index 100% rename from static_assert_test_fail_7.cpp rename to test/static_assert_test_fail_7.cpp diff --git a/static_assert_test_fail_8.cpp b/test/static_assert_test_fail_8.cpp similarity index 100% rename from static_assert_test_fail_8.cpp rename to test/static_assert_test_fail_8.cpp diff --git a/static_assert_test_fail_9.cpp b/test/static_assert_test_fail_9.cpp similarity index 100% rename from static_assert_test_fail_9.cpp rename to test/static_assert_test_fail_9.cpp