security/nss/tests/libpkix/runTests.sh

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 #! /bin/sh
michael@0 2 #
michael@0 3 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 6 #
michael@0 7 # runTests.sh#
michael@0 8 #
michael@0 9 # This script enables all tests to be run together. It simply cd's into
michael@0 10 # the pkix_tests and pkix_pl_tests directories and runs test scripts
michael@0 11 #
michael@0 12 # This test is the original of libpkix.sh. While libpkix.sh is invoked by
michael@0 13 # all.sh as a /bin/sh script, runTests.sh is a /bin/ksh and provides the
michael@0 14 # options of checking memory and using different memory allcation schemes.
michael@0 15 #
michael@0 16
michael@0 17 errors=0
michael@0 18 pkixErrors=0
michael@0 19 pkixplErrors=0
michael@0 20 checkMemArg=""
michael@0 21 arenasArg=""
michael@0 22 quietArg=""
michael@0 23 memText=""
michael@0 24
michael@0 25 ### ParseArgs
michael@0 26 ParseArgs() # args
michael@0 27 {
michael@0 28 while [ $# -gt 0 ]; do
michael@0 29 if [ $1 = "-checkmem" ]; then
michael@0 30 checkMemArg=$1
michael@0 31 memText=" (Memory Checking Enabled)"
michael@0 32 elif [ $1 = "-quiet" ]; then
michael@0 33 quietArg=$1
michael@0 34 elif [ $1 = "-arenas" ]; then
michael@0 35 arenasArg=$1
michael@0 36 fi
michael@0 37 shift
michael@0 38 done
michael@0 39 }
michael@0 40
michael@0 41 ParseArgs $*
michael@0 42
michael@0 43 echo "*******************************************************************************"
michael@0 44 echo "START OF ALL TESTS${memText}"
michael@0 45 echo "*******************************************************************************"
michael@0 46 echo ""
michael@0 47
michael@0 48 echo "RUNNING tests in pkix_pl_test";
michael@0 49 cd pkix_pl_tests;
michael@0 50 runPLTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
michael@0 51 pkixplErrors=$?
michael@0 52
michael@0 53 echo "RUNNING tests in pkix_test";
michael@0 54 cd ../pkix_tests;
michael@0 55 runTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
michael@0 56 pkixErrors=$?
michael@0 57
michael@0 58 echo "RUNNING tests in sample_apps (performance)";
michael@0 59 cd ../sample_apps;
michael@0 60 runPerf.sh ${arenasArg} ${checkMemArg} ${quietArg}
michael@0 61 pkixPerfErrors=$?
michael@0 62
michael@0 63 errors=`expr ${pkixplErrors} + ${pkixErrors} + ${pkixPerfErrors}`
michael@0 64
michael@0 65 if [ ${errors} -eq 0 ]; then
michael@0 66 echo ""
michael@0 67 echo "************************************************************"
michael@0 68 echo "END OF ALL TESTS: ALL TESTS COMPLETED SUCCESSFULLY"
michael@0 69 echo "************************************************************"
michael@0 70 exit 0
michael@0 71 fi
michael@0 72
michael@0 73 if [ ${errors} -eq 1 ]; then
michael@0 74 plural=""
michael@0 75 else
michael@0 76 plural="S"
michael@0 77 fi
michael@0 78
michael@0 79 echo ""
michael@0 80 echo "************************************************************"
michael@0 81 echo "END OF ALL TESTS: ${errors} TEST${plural} FAILED"
michael@0 82 echo "************************************************************"
michael@0 83 exit 1
michael@0 84
michael@0 85
michael@0 86
michael@0 87

mercurial