Bug 1560593 - Check that BUILD_OPT is defined before testing its value. r=jcj NSS_3_46_BETA1
authorKevin Jacobs <kjacobs@mozilla.com>
Fri, 23 Aug 2019 18:59:19 +0000
changeset 15270 44aa330de2aa0072d6121d82516d39a00346c1b9
parent 15269 da284d8993eac4299f9a9fe4522bcdcfa2dda62a
child 15271 d3035cc9dc7327df53bf9edc391f5f20782d93be
push id3479
push userjjones@mozilla.com
push dateFri, 23 Aug 2019 19:00:12 +0000
reviewersjcj
bugs1560593
Bug 1560593 - Check that BUILD_OPT is defined before testing its value. r=jcj Differential Revision: https://phabricator.services.mozilla.com/D43282
tests/common/cleanup.sh
--- a/tests/common/cleanup.sh
+++ b/tests/common/cleanup.sh
@@ -1,19 +1,19 @@
 #!/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
+    if [ -z "${BUILD_OPT}" ] && [ "${OBJDIR}" == "Debug"  ]; then
         BUILD_OPT=0;
-    elif [ -z "${BUILD_OPT}" ] && [ "$OBJDIR" == "Release" ]; then
+    elif [ -z "${BUILD_OPT}" ] && [ "${OBJDIR}" == "Release" ]; then
         BUILD_OPT=1;
     fi
 
     echo
     echo "SUMMARY:"
     echo "========"
     echo "NSS variables:"
     echo "--------------"
@@ -55,13 +55,13 @@ if [ -z "${CLEANUP}" -o "${CLEANUP}" = "
         echo "TinderboxPrint:Unknown: ${LINES_CNT}"
     fi
     echo
 
     html "END_OF_TEST<BR>"
     html "</BODY></HTML>"
     rm -f ${TEMPFILES} 2>/dev/null
     if [ ${FAILED_CNT} -gt 0 ] || [ ${ASAN_CNT} -gt 0 ] ||
-       ([ ${BUILD_OPT} -eq 1 ] && [ ${CORE_CNT} -gt 0 ]); then
+       ([ ${CORE_CNT} -gt 0 ] && [ -n "${BUILD_OPT}" ] && [ ${BUILD_OPT} -eq 1 ]); then
         exit 1
     fi
 
 fi