Bug 1560593 - Cleanup.sh to treat core dumps as test failures on optimized builds. r=jcj
authorKevin Jacobs <kjacobs@mozilla.com>
Fri, 09 Aug 2019 16:00:48 +0000
changeset 15247 360010725fdb499e0c63f8b37385f9c914808a0b
parent 15246 89aa19677e37b98e7725ccf491940c6cbb042296
child 15248 cef2aa7f3b8ce52571ac4b82242ba75cdeb756ef
push id3459
push userjjones@mozilla.com
push dateFri, 09 Aug 2019 16:01:52 +0000
reviewersjcj
bugs1560593
Bug 1560593 - Cleanup.sh to treat core dumps as test failures on optimized builds. r=jcj Differential Revision: https://phabricator.services.mozilla.com/D41392
tests/common/cleanup.sh
--- a/tests/common/cleanup.sh
+++ b/tests/common/cleanup.sh
@@ -1,16 +1,22 @@
 #!/bin/bash
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
 if [ -z "${CLEANUP}" -o "${CLEANUP}" = "${SCRIPTNAME}" ]; then
+    if [ -z "${BUILD_OPT}" ] && [ "$OBJDIR" == "Debug"  ]; then
+        BUILD_OPT=0;
+    elif [ -z "${BUILD_OPT}" ] && [ "$OBJDIR" == "Release" ]; then
+        BUILD_OPT=1;
+    fi
+
     echo
     echo "SUMMARY:"
     echo "========"
     echo "NSS variables:"
     echo "--------------"
     echo "HOST=${HOST}"
     echo "DOMSUF=${DOMSUF}"
     echo "BUILD_OPT=${BUILD_OPT}"
@@ -46,15 +52,16 @@ if [ -z "${CLEANUP}" -o "${CLEANUP}" = "
     LINES_CNT=$(cat ${RESULTS} | grep ">Unknown<" | wc -l | sed s/\ *//)
     echo "Unknown status:     ${LINES_CNT}"
     if [ ${LINES_CNT} -gt 0 ]; then
         echo "TinderboxPrint:Unknown: ${LINES_CNT}"
     fi
     echo
 
     html "END_OF_TEST<BR>"
-    html "</BODY></HTML>" 
+    html "</BODY></HTML>"
     rm -f ${TEMPFILES} 2>/dev/null
-    if [ ${FAILED_CNT} -gt 0 ] || [ ${ASAN_CNT} -gt 0 ]; then
+    if [ ${FAILED_CNT} -gt 0 ] || [ ${ASAN_CNT} -gt 0 ] ||
+       ([ ${BUILD_OPT} -eq 1 ] && [ ${CORE_CNT} -gt 0 ]); then
         exit 1
     fi
 
 fi