summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormayeut <mayeut@users.noreply.github.com>2015-09-12 20:06:31 +0200
committermayeut <mayeut@users.noreply.github.com>2015-09-12 20:06:31 +0200
commitc08bd897394510513d0dcf6ff6d3cd5936c603cb (patch)
tree9bbee632e5c2cb71cd689a09c63c23460e9ce67a
parent1621df453d493b10bc2b8d0b6332c278abfb49a4 (diff)
Travis fix error when no tests are done
-rwxr-xr-xtools/travis-ci/run.sh34
1 files changed, 21 insertions, 13 deletions
diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh
index c68d2da2..ec3b7d34 100755
--- a/tools/travis-ci/run.sh
+++ b/tools/travis-ci/run.sh
@@ -131,26 +131,34 @@ Parsing logs for new/unknown failures
"
OPJ_CI_RESULT=0
-awk -F: '{ print $2 }' build/Testing/Temporary/LastTestsFailed_*.log > failures.txt
-
-while read FAILEDTEST; do
- # Start with common errors
- if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-all.txt > /dev/null; then
- continue
- fi
- if [ -f ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt ]; then
- if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt > /dev/null; then
+OPJ_HAS_TESTS=$(find build -path 'build/Testing/Temporary*' -name 'LastTestsFailed*' | wc -l)
+OPJ_HAS_TESTS=$(echo $OPJ_HAS_TESTS) #macos wc workaround
+
+if [ $OPJ_HAS_TESTS -ne 0 ]; then
+ awk -F: '{ print $2 }' build/Testing/Temporary/LastTestsFailed_*.log > failures.txt
+ while read FAILEDTEST; do
+ # Start with common errors
+ if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-all.txt > /dev/null; then
continue
fi
- fi
- echo "${FAILEDTEST}"
- OPJ_CI_RESULT=1
-done < failures.txt
+ if [ -f ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt ]; then
+ if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt > /dev/null; then
+ continue
+ fi
+ fi
+ echo "${FAILEDTEST}"
+ OPJ_CI_RESULT=1
+ done < failures.txt
+fi
# TODO parse memcheck
if [ ${OPJ_CI_RESULT} -eq 0 ]; then
echo "No new/unknown failure found"
+else
+ echo "
+New/unknown failures found!!!
+"
fi
exit ${OPJ_CI_RESULT}