From 56c9fa1bccad9078d68f8a7abe309c75d37224df Mon Sep 17 00:00:00 2001 From: Justin Israel Date: Wed, 29 Aug 2018 14:16:24 +1200 Subject: [PATCH] adjust travis config to get scripts to run --- .travis.yml | 75 +++++++++++++++++++++++++++++++++++++---------------- cpp/wscript | 4 ++- 2 files changed, 55 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0df720c..dbeab5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,35 +1,54 @@ language: go - -# This will run on Travis' 'new' container-based infrastructure -sudo: false +git: + depth: 1 + cache: apt: true - -addons: - apt: - packages: - - doxygen - - doxygen-doc - - doxygen-latex - - doxygen-gui - - graphviz - -matrix: - include: - - go: "1.10.x" - script: go test -v $(go list ./... | grep -v /vendor/) - - go: "1.11.x" - script: go test -v -mod=vendor ./... + directories: + - "$HOME/opt" env: - - GO111MODULE=on - + global: + - WAF_VERSION=waf-1.9.14 + install: true jobs: include: + - go: "1.10.x" + env: USEMOD=0 + script: go test -v $(go list ./... | grep -v /vendor/) + + - go: "1.11.x" + env: USEMOD=1 GO111MODULE=on + script: go test -v -mod=vendor ./... + + - stage: cpp-test + language: cpp + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-4.9 + - g++-4.9 + before_install: + - export PATH=$HOME/opt/waf-${WAF_VERSION}:$PATH + - if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi + - test -x waf-light || { + cd "$HOME/opt" && + wget "https://gitlab.com/ita1024/waf/-/archive/${WAF_VERSION}/waf-${WAF_VERSION}.tar.gz" && + tar -zxf "waf-${WAF_VERSION}.tar.gz" && + cd "waf-${WAF_VERSION}" && + ./waf-light configure build && + cd $TRAVIS_BUILD_DIR; } + script: + - cd ${TRAVIS_BUILD_DIR}/cpp + - waf-light configure test + - stage: deploy + script: skip if: tag =~ ^v\d+ deploy: provider: script @@ -38,9 +57,19 @@ jobs: on: tags: true condition: $TRAVIS_OS_NAME = linux - + - stage: doxygen - script: cd cpp/docs && doxygen && cd $TRAVIS_BUILD_DIR + language: cpp + addons: + apt: + packages: + - doxygen + - doxygen-doc + - doxygen-latex + - doxygen-gui + - graphviz + script: + - cd cpp/docs && doxygen && cd $TRAVIS_BUILD_DIR deploy: provider: pages project-name: libfileseq diff --git a/cpp/wscript b/cpp/wscript index ef352e9..4ffb3fd 100644 --- a/cpp/wscript +++ b/cpp/wscript @@ -66,6 +66,7 @@ def _create_test(bld): 'test/gtest/src/gtest-all.cc']), includes = [ "test", "test/gtest/include", "test/gtest", "." ], use = use, + lib = ['pthread'], stlib = stlib, cxxflags = ["-Wno-undef", "-g", "-ggdb"], defines = ["FILESEQ_TEST_DIR=%s" % bld.path.parent.abspath()], @@ -105,9 +106,10 @@ def check_cxx_regex(ctx): okmsg="Done", cxxflags=['-std=c++11'], fragment=REGEX_CPP_TEST, + mandatory=False, ) - if have_regex.strip() == "1": + if have_regex and have_regex.strip() == "1": ctx.define("HAVE_REGEX", 1, comment="C++11 is supported") else: ctx.check_cxx(