diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /security/nss/tests/gtests/gtests.sh | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'security/nss/tests/gtests/gtests.sh')
-rwxr-xr-x | security/nss/tests/gtests/gtests.sh | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/security/nss/tests/gtests/gtests.sh b/security/nss/tests/gtests/gtests.sh new file mode 100755 index 000000000..f91349b9e --- /dev/null +++ b/security/nss/tests/gtests/gtests.sh @@ -0,0 +1,88 @@ +#! /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/. + +######################################################################## +# +# similar to all.sh this file runs drives gtests. +# +# needs to work on all Unix and Windows platforms +# +# special strings +# --------------- +# FIXME ... known problems, search for this string +# NOTE .... unexpected behavior +# +######################################################################## + +############################## gtest_init ############################## +# local shell function to initialize this script +######################################################################## +gtest_init() +{ + cd "$(dirname "$1")" + if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then + cd common + . ./init.sh + fi + + SCRIPTNAME=gtests.sh + + if [ -z "${CLEANUP}" ] ; then # if nobody else is responsible for + CLEANUP="${SCRIPTNAME}" # cleaning this script will do it + fi +} + +########################## gtest_start ############################# +# Local function to actually start the test +#################################################################### +gtest_start() +{ + echo "gtests: ${GTESTS}" + for i in ${GTESTS}; do + if [ ! -f ${BINDIR}/$i ]; then + html_unknown "Skipping $i (not built)" + continue + fi + GTESTDIR="${HOSTDIR}/$i" + html_head "$i" + if [ ! -d "$GTESTDIR" ]; then + mkdir -p "$GTESTDIR" + fi + cd "$GTESTDIR" + GTESTREPORT="$GTESTDIR/report.xml" + PARSED_REPORT="$GTESTDIR/report.parsed" + echo "executing $i" + ${BINDIR}/$i -d "$GTESTDIR" --gtest_output=xml:"${GTESTREPORT}" \ + --gtest_filter="${GTESTFILTER-*}" + html_msg $? 0 "$i run successfully" + echo "test output dir: ${GTESTREPORT}" + echo "executing sed to parse the xml report" + sed -f ${COMMON}/parsegtestreport.sed "${GTESTREPORT}" > "${PARSED_REPORT}" + echo "processing the parsed report" + cat "${PARSED_REPORT}" | while read result name; do + if [ "$result" = "notrun" ]; then + echo "$name" SKIPPED + elif [ "$result" = "run" ]; then + html_passed_ignore_core "$name" + else + html_failed_ignore_core "$name" + fi + done + done +} + +gtest_cleanup() +{ + html "</TABLE><BR>" + cd ${QADIR} + . common/cleanup.sh +} + +################## main ################################################# +GTESTS="der_gtest pk11_gtest util_gtest" +gtest_init $0 +gtest_start +gtest_cleanup |