From b3b383a0260881ef7d4bf581aa0f4f08e1baf736 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 29 Nov 2016 20:08:08 +0000 Subject: [PATCH] skip performance test if we cant get a baseline --- .travis.yml | 1 + tests/perf_to_string.test | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index f4f4926..12058c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,7 @@ before_script: script: - if [ "$CC" == "clang" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then scan-build-3.6 --status-bugs make check TESTS="" && make clean ; fi + - sudo apt-cache search callgrind - make - valgrind --tool callgrind ls - export VERBOSE=1 diff --git a/tests/perf_to_string.test b/tests/perf_to_string.test index 29054c7..441276d 100755 --- a/tests/perf_to_string.test +++ b/tests/perf_to_string.test @@ -10,6 +10,11 @@ # first, get baseline from system-installed library rm -f callgrind.out &> /dev/null valgrind --tool=callgrind --callgrind-out-file=callgrind.out .libs/perf_to_string +if [ $? -ne 0 ]; then + echo "Error obtaining performance baseline, assuming system is not able to" + echo "support this test - skipping" + exit 77 +fi export RETCODE=$? echo return code $RETCODE MAXCYCLES=$(grep < callgrind.out "^totals:" | tr -dc '0-9')