From 96bec628e738ddbc8780c1ed5d0bfa503a7379f3 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 15 Sep 2019 07:18:30 -0600 Subject: [PATCH] simplify travis script by putting all common bjam command line arguments in a variable --- .travis.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3dcb6fd7a..9b80de1fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -212,19 +212,23 @@ script: ${B2} -a -j3 clang_tidy; fi' + # the common boost-build command line arguments. It's important they are all + # the same, in order for builds to be reused between invocations + - export B2_ARGS="crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant" + - 'if [ "$check_headers" == "1" ]; then - ${B2} -j3 check-headers crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant; + ${B2} -j3 check-headers ${B2_ARGS}; fi' # if we are building with code coverage, report it as soon as possible # libtorrent is the name of the test suite target - cd test - 'if [ "$tests" == "1" ]; then - ${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant testing.execute=off && - travis_retry ${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant -l300 && - travis_retry ${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant test_natpmp enum_if -l300 && + ${B2} -j3 warnings-as-errors=on warnings=all ${B2_ARGS} testing.execute=off && + travis_retry ${B2} -j3 warnings-as-errors=on warnings=all ${B2_ARGS} -l300 && + travis_retry ${B2} -j3 warnings-as-errors=on warnings=all ${B2_ARGS} test_natpmp enum_if -l300 && if [[ $TRAVIS_OS_NAME != "osx" ]]; then - travis_retry ${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant test_lsd -l300; + travis_retry ${B2} -j3 warnings-as-errors=on warnings=all ${B2_ARGS} test_lsd -l300; fi && if [ "$coverage" == "1" ]; then codecov --root .. --gcov-exec gcov-5; @@ -240,13 +244,13 @@ script: - cd ../examples - 'if [ "$examples" == "1" ]; then - ${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant link=shared; + ${B2} -j3 warnings-as-errors=on warnings=all ${B2_ARGS} link=shared; fi' - cd .. - cd tools - 'if [ "$tools" == "1" ]; then - ${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant link=shared; + ${B2} -j3 warnings-as-errors=on warnings=all ${B2_ARGS} link=shared; fi' - cd .. @@ -258,7 +262,7 @@ script: # on OSX we need to use the brew version of python, for reasons explained above - cd bindings/python - 'if [[ "$python" == "1" ]]; then - ${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant stage_module stage_dependencies libtorrent-link=shared boost-link=shared && + ${B2} -j3 warnings-as-errors=on warnings=all ${B2_ARGS} stage_module stage_dependencies libtorrent-link=shared boost-link=shared && if [[ $TRAVIS_OS_NAME == "osx" ]]; then DYLD_LIBRARY_PATH=./dependencies python2 test.py -b; else