3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
16 # The Original Code is the Netscape security libraries.
18 # The Initial Developer of the Original Code is
19 # Netscape Communications Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 1994-2000
21 # the Initial Developer. All Rights Reserved.
25 # Alternatively, the contents of this file may be used under the terms of
26 # either the GNU General Public License Version 2 or later (the "GPL"), or
27 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
50 ############################## libpkix_init ###############################
51 # local shell function to initialize this script
52 ########################################################################
55 SCRIPTNAME
="libpkixs.sh"
56 if [ -z "${CLEANUP}" ] ; then # if nobody else is responsible for
57 CLEANUP
="${SCRIPTNAME}" # cleaning this script will do it
61 if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ] ; then
67 # test at libpkix is written in ksh and hence cannot be sourced "."
68 # by this sh script. While we want to provide each libpkix test script the
69 # ability to be executed alone, we will need to use common/init.sh
70 # to set up bin etc. Since variable values can not be passed to sub-directory
71 # script for checking ($INIT_SOURCED), log is recreated and old data lost.
72 # The cludge way provided here is not ideal, but works (for now) :
73 # We save the log up to this point then concatenate it with libpkix log
75 LOGFILE_ALL
=${LOGFILE}
76 if [ ! -z ${LOGFILE_ALL} ] ; then
77 mv ${LOGFILE_ALL} ${LOGFILE_ALL}.tmp
81 SCRIPTNAME
="libpkixs.sh"
82 LIBPKIX_LOG
=${HOSTDIR}/libpkix.log
#we don't want all the errormessages
83 # in the output.log, otherwise we can't tell what's a real error
85 html_head
"LIBPKIX Tests"
89 ############################## libpkix_cleanup ############################
90 # local shell function to finish this script (no exit since it might be
92 ########################################################################
95 if [ ! -z ${LOGFILE_ALL} ] ; then
97 cat ${LOGFILE_ALL}.tmp ${LIBPKIX_LOG} > ${LOGFILE_ALL}
108 while [ $# -gt 0 ]; do
109 if [ $1 == "-checkmem" ]; then
111 memText
=" (Memory Checking Enabled)"
112 elif [ $1 == "-quiet" ]; then
114 elif [ $1 == "-arenas" ]; then
126 echo "*******************************************************************************"
127 echo "START OF ALL TESTS${memText}"
128 echo "*******************************************************************************"
131 echo "RUNNING tests in pkix_pl_test";
132 html_msg
0 0 "Running tests in pkix_pl_test:"
134 runPLTests.sh
${arenasArg} ${checkMemArg} ${quietArg}
136 html_msg $?
0 "Results of tests in pkix_pl_test"
138 echo "RUNNING tests in pkix_test";
139 html_msg
0 0 "Running tests in pkix_test:"
141 runTests.sh
${arenasArg} ${checkMemArg} ${quietArg}
143 html_msg $?
0 "Results of tests in pkix_test"
145 echo "RUNNING performance tests in sample_apps";
146 html_msg
0 0 "Running performance tests in sample_apps:"
148 runPerf.sh
${arenasArg} ${checkMemArg} ${quietArg}
150 html_msg $?
0 "Results of performance tests in sample_apps"
152 totalErrors
=`expr ${pkixErrors} + ${pkixplErrors} + ${pkixPerfErrors}`
154 if [ ${totalErrors} -eq 0 ]; then
156 echo "************************************************************"
157 echo "END OF ALL TESTS: ALL TESTS COMPLETED SUCCESSFULLY"
158 echo "************************************************************"
159 html_msg
${totalErrors} 0 "ALL LIBPKIX TESTS COMPLETED SUCCESSFULLY"
164 if [ ${totalErrors} -eq 1 ]; then
170 if [ ${totalErrors} -ne 0 ]; then
172 echo "************************************************************"
173 echo "END OF ALL TESTS: ${totalErrors} TEST${plural} FAILED"
174 echo "************************************************************"
175 html_msg
1 0 "${totalErrors} LIBPKIX TEST${plural} FAILED"
180 ################## main #################################################
183 libpkix_main |
tee ${LIBPKIX_LOG}