From f1c51cb19cb591ef99e9ae673da9067d2629be79 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Thu, 19 May 2016 09:56:23 -0400 Subject: [PATCH 1/5] Added BOOST_TEST_NOT to lightweight test. --- include/boost/core/lightweight_test.hpp | 1 + 1 file changed, 1 insertion(+) 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) ) From fd022e2d86e71a17bc89b756a3777e2ebf911b35 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Fri, 20 May 2016 05:22:20 -0400 Subject: [PATCH 2/5] Added documentation and tests for BOOST_TEST_NOT. --- doc/lightweight_test.qbk | 12 ++++++++++++ test/lightweight_test_test.cpp | 10 ++++++++++ 2 files changed, 22 insertions(+) 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/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 From 29810a490a3df859a9eb30b525b03c1bdd255286 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 10 Sep 2016 01:49:51 +0300 Subject: [PATCH 3/5] Change Appveyor to use msvc-14.0 because 12.0 doesn't work. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 03c3982..a915c65 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,4 +31,4 @@ install: 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 From 5263c5d47f6e57eb9d5e10e31c031169d61adee6 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 10 Sep 2016 01:50:43 +0300 Subject: [PATCH 4/5] Enable Travis notifications on success. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index ee2b3ad..ff6fab5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,3 +36,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 From 815625904311e29fe3fb83f0ef3f012a4a94572f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 10 Sep 2016 13:50:36 +0300 Subject: [PATCH 5/5] Copy repo instead of doing a checkout, for pull requests. --- .travis.yml | 10 ++++------ appveyor.yml | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index ff6fab5..6b7ec2f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,19 +16,17 @@ 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 update - - cd libs/core - - git checkout -q $TRAVIS_COMMIT - - cd ../.. + - cp -r $TRAVIS_BUILD_DIR/* libs/core - ./bootstrap.sh - ./b2 headers diff --git a/appveyor.yml b/appveyor.yml index a915c65..501288d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,19 +12,17 @@ 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 update - - cd libs\core - - git checkout -q %APPVEYOR_REPO_COMMIT% - - cd ..\.. + - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\core - bootstrap - b2 headers