tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

runTests.sh (2191B)


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