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 }