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