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
10curdir=`pwd`
11cd ../common
12. ./libpkix_init.sh > /dev/null
13cd ${curdir}
14
15testunit="PKIX"
16
17totalErrors=0
18utilErrors=0
19crlselErrors=0
20paramsErrors=0
21resultsErrors=0
22topErrors=0
23checkerErrors=0
24certselErrors=0
25quiet=0
26
27checkMemArg=""
28arenasArg=""
29quietArg=""
30memText=""
31
32### ParseArgs
33ParseArgs() # args
34{
35    while [ $# -gt 0 ]; do
36        if [ $1 = "-checkmem" ]; then
37            checkMemArg=$1
38            memText="   (Memory Checking Enabled)"
39        elif [ $1 = "-quiet" ]; then
40            quietArg=$1
41            quiet=1
42        elif [ $1 = "-arenas" ]; then
43            arenasArg=$1
44        fi
45        shift
46    done
47}
48
49ParseArgs $*
50
51testHeadingEcho
52
53echo "RUNNING tests in certsel";
54cd certsel;
55runTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
56certselErrors=$?
57
58echo "RUNNING tests in checker";
59cd ../checker;
60runTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
61checkerErrors=$?
62
63echo "RUNNING tests in results";
64cd ../results;
65runTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
66resultsErrors=$?
67
68echo "RUNNING tests in params";
69cd ../params;
70runTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
71paramsErrors=$?
72
73echo "RUNNING tests in crlsel";
74cd ../crlsel;
75runTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
76crlselErrors=$?
77
78echo "RUNNING tests in store";
79cd ../store;
80runTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
81storeErrors=$?
82
83echo "RUNNING tests in util";
84cd ../util;
85runTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
86utilErrors=$?
87
88echo "RUNNING tests in top";
89cd ../top;
90runTests.sh ${arenasArg} ${checkMemArg} ${quietArg}
91topErrors=$?
92
93totalErrors=`expr ${certselErrors} + ${checkerErrors} + ${resultsErrors} + ${paramsErrors} + ${crlselErrors} + ${storeErrors} + ${utilErrors} + ${topErrors}`
94
95testEndingEcho
96
97exit ${totalErrors}
98
99