From c456c920cc80f4bce73e84c201a96547f6ffe2ea Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Sat, 21 Nov 2015 00:43:32 -0500 Subject: [PATCH] fix travis --- .travis.yml | 6 +++--- tests/helpers/path_helper.hpp | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e465e40b..86041c69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,11 +39,11 @@ script: - ../bin/xlnt.test after_success: - - if [ "$COMPILER" = "g++-4.9" ]; then rm -rf ./* ; cd build ; fi + - if [ "$COMPILER" = "g++-4.9" ]; then rm -rf ./* ; fi - if [ "$COMPILER" = "g++-4.9" ]; then cmake -G "Unix Makefiles" -D SHARED=1 -D BUILD_TESTS=1 -D CMAKE_CXX_COMPILER=$COMPILER -D CMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage" ../cmake ; fi - if [ "$COMPILER" = "g++-4.9" ]; then make ; fi - - if [ "$COMPILER" = "g++-4.9" ]; then ../bin/xlnt.test ; fi - - if [ "$COMPILER" = "g++-4.9" ]; then coveralls --include ../source/worksheet/test_worksheet.hpp --gcov-options '\-lp' --gcov 'gcov-4.9' ; fi + - if [ "$COMPILER" = "g++-4.9" ]; then cd .. && ./bin/xlnt.test ; fi + - if [ "$COMPILER" = "g++-4.9" ]; then coveralls --exclude bin --exclude build --exclude cmake --exclude docs --include include --exclude lib --exclude samples --exclude source --exclude tests --exclude third-party --include source/worksheet/test_worksheet.hpp --gcov-options '\-lp' --gcov 'gcov-4.9' ; fi notifications: email: false diff --git a/tests/helpers/path_helper.hpp b/tests/helpers/path_helper.hpp index f52ce6e7..48cd3f1e 100644 --- a/tests/helpers/path_helper.hpp +++ b/tests/helpers/path_helper.hpp @@ -83,8 +83,9 @@ public: char exepath[PATH_MAX + 1] = {0}; sprintf(arg1, "/proc/%d/exe", getpid()); - readlink(arg1, exepath, 1024); - return std::string(exepath).substr(0, std::strlen(exepath) - 9); + auto bytes_written = readlink(arg1, exepath, 1024); + + return std::string(exepath).substr(0, bytes_written - 9); #endif }