diff --git a/.travis.yml b/.travis.yml index a409e36..e8f6bb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,20 +16,18 @@ branches: - develop install: - - git clone -b $TRAVIS_BRANCH https://github.com/boostorg/boost.git boost - - cd boost + - cd .. + - git clone -b $TRAVIS_BRANCH https://github.com/boostorg/boost.git boost-root + - cd boost-root - git submodule init libs/assert - git submodule init libs/config - - git submodule init libs/core - git submodule init libs/predef - git submodule init libs/static_assert - git submodule init libs/type_traits - git submodule init tools/build - git submodule init tools/inspect - git submodule update - - cd libs/core - - git checkout -q $TRAVIS_COMMIT - - cd ../.. + - cp -r $TRAVIS_BUILD_DIR/* libs/core - ./bootstrap.sh - ./b2 headers @@ -37,3 +35,7 @@ script: - TOOLSET=gcc,clang - if [ $TRAVIS_OS_NAME == osx ]; then TOOLSET=clang; fi - ./b2 libs/core/test toolset=$TOOLSET + +notifications: + email: + on_success: always diff --git a/appveyor.yml b/appveyor.yml index d9d2ca5..6644d6d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,24 +12,22 @@ branches: - develop install: - - git clone -b %APPVEYOR_REPO_BRANCH% https://github.com/boostorg/boost.git boost - - cd boost + - cd .. + - git clone -b %APPVEYOR_REPO_BRANCH% https://github.com/boostorg/boost.git boost-root + - cd boost-root - git submodule init libs/assert - git submodule init libs/config - - git submodule init libs/core - git submodule init libs/predef - git submodule init libs/static_assert - git submodule init libs/type_traits - git submodule init tools/build - git submodule init tools/inspect - git submodule update - - cd libs\core - - git checkout -q %APPVEYOR_REPO_COMMIT% - - cd ..\.. + - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\core - bootstrap - b2 headers build: off test_script: - - b2 libs/core/test toolset=msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0 + - b2 libs/core/test toolset=msvc-9.0,msvc-10.0,msvc-11.0,msvc-14.0 diff --git a/doc/lightweight_test.qbk b/doc/lightweight_test.qbk index 7b706c3..4b9abd1 100644 --- a/doc/lightweight_test.qbk +++ b/doc/lightweight_test.qbk @@ -32,6 +32,7 @@ When using `lightweight_test.hpp`, *do not forget* to `` #define BOOST_TEST(expression) /*unspecified*/ +#define BOOST_TEST_NOT(expression) /*unspecified*/ #define BOOST_ERROR(message) /*unspecified*/ #define BOOST_TEST_EQ(expr1, expr2) /*unspecified*/ #define BOOST_TEST_NE(expr1, expr2) /*unspecified*/ @@ -56,6 +57,17 @@ message containing `expression`. [endsect] +[section BOOST_TEST_NOT] + +`` +BOOST_TEST_NOT(expression) +`` + +If expression is true increases the error count and outputs a +message containing `!(expression)`. + +[endsect] + [section BOOST_ERROR] `` diff --git a/include/boost/core/lightweight_test.hpp b/include/boost/core/lightweight_test.hpp index cdc8a72..e0fc90b 100644 --- a/include/boost/core/lightweight_test.hpp +++ b/include/boost/core/lightweight_test.hpp @@ -144,6 +144,7 @@ inline int report_errors() } // namespace boost #define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)) +#define BOOST_TEST_NOT(expr) BOOST_TEST(!(expr)) #define BOOST_ERROR(msg) ( ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) ) diff --git a/test/lightweight_test_test.cpp b/test/lightweight_test_test.cpp index a5193f2..d4808a1 100644 --- a/test/lightweight_test_test.cpp +++ b/test/lightweight_test_test.cpp @@ -43,6 +43,16 @@ int main() BOOST_TEST( x++ == 1 ); BOOST_TEST( x == 2? true: false ); BOOST_TEST( x == 2? &x: 0 ); + + // BOOST_TEST_NOT + + BOOST_TEST_NOT( x == 1 ); + BOOST_TEST_NOT( ++x == 2 ); + BOOST_TEST_NOT( x++ == 2 ); + BOOST_TEST_NOT( --x == 2 ); + BOOST_TEST_NOT( x-- == 2 ); + BOOST_TEST_NOT( x == 2? false: true ); + BOOST_TEST_NOT( x == 2? 0: &x ); // BOOST_TEST_EQ