Blame nss/tests/libpkix/runTests.sh

Packit 40b132
#! /bin/sh
Packit 40b132
#
Packit 40b132
# This Source Code Form is subject to the terms of the Mozilla Public
Packit 40b132
# License, v. 2.0. If a copy of the MPL was not distributed with this
Packit 40b132
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Packit 40b132
#
Packit 40b132
# runTests.sh#
Packit 40b132
#
Packit 40b132
# This script enables all tests to be run together. It simply cd's into
Packit 40b132
# the pkix_tests and pkix_pl_tests directories and runs test scripts
Packit 40b132
#
Packit 40b132
# This test is the original of libpkix.sh. While libpkix.sh is invoked by
Packit 40b132
# all.sh as a /bin/sh script, runTests.sh is a /bin/ksh and provides the
Packit 40b132
# options of checking memory and using different memory allcation schemes.
Packit 40b132
#
Packit 40b132
Packit 40b132
errors=0
Packit 40b132
pkixErrors=0
Packit 40b132
pkixplErrors=0
Packit 40b132
checkMemArg=""
Packit 40b132
arenasArg=""
Packit 40b132
quietArg=""
Packit 40b132
memText=""
Packit 40b132
Packit 40b132
### ParseArgs
Packit 40b132
ParseArgs() # args
Packit 40b132
{
Packit 40b132
    while [ $# -gt 0 ]; do
Packit 40b132
	if [ $1 = "-checkmem" ]; then
Packit 40b132
	    checkMemArg=$1
Packit 40b132
	    memText="   (Memory Checking Enabled)"
Packit 40b132
	elif [ $1 = "-quiet" ]; then
Packit 40b132
	    quietArg=$1
Packit 40b132
	elif [ $1 = "-arenas" ]; then
Packit 40b132
	    arenasArg=$1
Packit 40b132
	fi
Packit 40b132
	shift
Packit 40b132
    done
Packit 40b132
}
Packit 40b132
Packit 40b132
ParseArgs $*
Packit 40b132
Packit 40b132
echo "*******************************************************************************"
Packit 40b132
echo "START OF ALL TESTS${memText}"
Packit 40b132
echo "*******************************************************************************"
Packit 40b132
echo ""
Packit 40b132
Packit 40b132
echo "RUNNING tests in pkix_pl_test";
Packit 40b132
cd pkix_pl_tests;
Packit 40b132
runPLTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
Packit 40b132
pkixplErrors=$?
Packit 40b132
Packit 40b132
echo "RUNNING tests in pkix_test";
Packit 40b132
cd ../pkix_tests;
Packit 40b132
runTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
Packit 40b132
pkixErrors=$?
Packit 40b132
Packit 40b132
echo "RUNNING tests in sample_apps (performance)";
Packit 40b132
cd ../sample_apps;
Packit 40b132
runPerf.sh ${arenasArg} ${checkMemArg} ${quietArg}
Packit 40b132
pkixPerfErrors=$?
Packit 40b132
Packit 40b132
errors=`expr ${pkixplErrors} + ${pkixErrors} + ${pkixPerfErrors}`
Packit 40b132
Packit 40b132
if [ ${errors} -eq 0 ]; then
Packit 40b132
    echo ""
Packit 40b132
    echo "************************************************************"
Packit 40b132
    echo "END OF ALL TESTS: ALL TESTS COMPLETED SUCCESSFULLY"
Packit 40b132
    echo "************************************************************"
Packit 40b132
    exit 0
Packit 40b132
fi
Packit 40b132
Packit 40b132
if [ ${errors} -eq 1 ]; then
Packit 40b132
    plural=""
Packit 40b132
else
Packit 40b132
    plural="S"
Packit 40b132
fi
Packit 40b132
Packit 40b132
echo ""
Packit 40b132
echo "************************************************************"
Packit 40b132
echo "END OF ALL TESTS: ${errors} TEST${plural} FAILED"
Packit 40b132
echo "************************************************************"
Packit 40b132
exit 1
Packit 40b132
Packit 40b132
Packit 40b132
Packit 40b132