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/.
9 echo "usage: $0 <path-to-dist>"
17 export DYLD_LIBRARY_PATH
=${ABS_LIB}:${DYLD_LIBRARY_PATH}
18 export LD_LIBRARY_PATH
=${ABS_LIB}:${LD_LIBRARY_PATH}
19 export PATH
=${ABS_LIB}:${PATH}
23 # Bourne shell script for nspr tests
26 SYSTEM_INFO
=`uname -a`
29 if [ $OS_ARCH = "Windows_NT" ] ||
[ $OS_ARCH = "OS/2" ]
35 if [ $FILE_D -lt 512 ]
44 #bug1test - used to demonstrate a bug on NT
45 #bigfile2 - requires 4Gig file creation. See BugZilla #5451
46 #bigfile3 - requires 4Gig file creation. See BugZilla #5451
47 #dbmalloc - obsolete; originally for testing debug version of nspr's malloc
48 #dbmalloc1 - obsolete; originally for testing debug version of nspr's malloc
49 #depend - obsolete; used to test a initial spec for library dependencies
50 #dceemu - used to tests special functions in NSPR for DCE emulation
51 #ipv6 - IPV6 not in use by NSPR clients
52 #mbcs - tests use of multi-byte charset for filenames. See BugZilla #25140
53 #io_timeoutk - obsolete; subsumed in io_timeout
54 #io_timeoutu - obsolete; subsumed in io_timeout
55 #prftest1 - obsolete; subsumed by prftest
56 #prftest2 - obsolete; subsumed by prftest
57 #prselect - obsolete; PR_Select is obsolete
58 #select2 - obsolete; PR_Select is obsolete
59 #sem - obsolete; PRSemaphore is obsolete
61 #suspend - private interfaces PR_SuspendAll, PR_ResumeAll, etc..
62 #thruput - needs to be run manually as client/server
63 #time - used to measure time with native calls and nspr calls
64 #tmoacc - should be run with tmocon
65 #tmocon - should be run with tmoacc
66 #op_noacc - limited use
67 #yield - limited use for PR_Yield
70 # Tests not run (but should)
73 #forktest (failed on IRIX)
74 #multiwait - fails on Linux 64bit since NSPR v 4.4 from 2004.
75 #nbconn - fails on some platforms
76 #poll_er - fails on some platforms? limited use?
77 #prpoll - the bad-FD test needs to be moved to a different test
78 #sleep - specific to OS/2
80 # all of the following were disabled in 2019 when reenabling CI tests,
81 # because they failed on at least one of the platforms:
101 #LOGFILE=${NSPR_TEST_LOGFILE:-$NULL_DEVICE}
102 LOGFILE
=nspr-test.log
105 # Tests run on all platforms
213 # When set, value of the environment variable TEST_TIMEOUT is the maximum
214 # time (secs) allowed for a test program beyond which it is terminated.
215 # If TEST_TIMEOUT is not set or if it's value is 0, then test programs
218 # Running runtests.ksh under MKS toolkit on NT, 95, 98 does not cause
219 # timeout detection correctly. For these platforms, do not attempt timeout
225 OBJDIR
=`basename $PWD`
226 printf "\nNSPR Test Results - $OBJDIR\n\n"
227 printf "BEGIN\t\t\t`date`\n"
228 printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n"
229 printf "Test\t\t\tResult\n\n"
230 if [ $OS_PLATFORM = "Windows_95" ] ||
[ $OS_PLATFORM = "Windows_98" ] ||
[ $OS_PLATFORM = "Windows_NT" ] ||
[ $OS_PLATFORM = "OS/2" ] ; then
233 printf "$prog (`date +%T`)"
234 printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
235 .
/$prog >> ${LOGFILE} 2>&1
237 printf "\t\t\tPassed\n";
239 printf "\t\t\tFAILED\n";
242 printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
247 printf "$prog (`date +%T`)"
248 printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
250 .
/$prog >> ${LOGFILE} 2>&1 &
253 if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
255 (sleep $TEST_TIMEOUT; kill $test_pid >/dev
/null
2>&1 ) &
260 [ $sleep_pid -eq 0 ] ||
kill $sleep_pid >/dev
/null
2>&1
261 if [ 0 = $test_rval ] ; then
262 printf "\t\t\tPassed\n";
264 printf "\t\t\tFAILED\n";
267 printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
271 if [ $rval -ne 0 ]; then
275 printf "END\t\t\t`date`\n"