Bug 1825055 [wpt PR 39247] - Add support for allowing elements with display:contents...
[gecko.git] / nsprpub / pr / tests / runtests.sh
blob8d3144019d5ad9cf0271fd761956183935b7d716
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/.
7 if test -z $1
8 then
9 echo "usage: $0 <path-to-dist>"
10 exit 1
13 cd $1/lib
14 ABS_LIB=$PWD
15 cd -
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}
22 # runtests.sh
23 # Bourne shell script for nspr tests
26 SYSTEM_INFO=`uname -a`
27 OS_ARCH=`uname -s`
29 if [ $OS_ARCH = "Windows_NT" ] || [ $OS_ARCH = "OS/2" ]
30 then
31 NULL_DEVICE=nul
32 else
33 NULL_DEVICE=/dev/null
34 FILE_D=`ulimit -n`
35 if [ $FILE_D -lt 512 ]
36 then
37 ulimit -n 512
42 # Irrevelant tests
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
60 #stat - for OS2?
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:
83 # cltsrv
84 # cvar
85 # gethost
86 # getproto
87 # layer
88 # logfile
89 # nameshm1
90 # nblayer
91 # nonblock
92 # ntioto
93 # op_2long
94 # parent
95 # provider
96 # ranfile
97 # socket
98 # sockopt
99 # vercheck
101 #LOGFILE=${NSPR_TEST_LOGFILE:-$NULL_DEVICE}
102 LOGFILE=nspr-test.log
105 # Tests run on all platforms
108 TESTS="
109 abstract
110 accept
111 acceptread
112 acceptreademu
113 affinity
114 alarm
115 anonfm
116 atomic
117 attach
118 bigfile
119 cleanup
120 concur
121 cvar2
122 dlltest
123 dtoa
124 errcodes
125 exit
126 fdcach
127 fileio
128 foreign
129 formattm
130 fsync
132 initclk
133 inrval
134 instrumt
135 intrio
136 intrupt
137 io_timeout
138 ioconthr
139 join
140 joinkk
141 joinku
142 joinuk
143 joinuu
144 lazyinit
145 libfilename
146 lltest
147 lock
148 lockfile
149 logger
150 many_cv
151 ntoh
152 op_excl
153 op_filnf
154 op_filok
155 op_nofil
156 parsetm
157 peek
158 perf
159 pipeping
160 pipeping2
161 pipeself
162 poll_nm
163 poll_to
164 pollable
165 prftest
166 prfz
167 primblok
168 prpollml
169 pushtop
170 randseed
171 reinit
172 rwlocktest
173 sel_spd
174 selct_er
175 selct_nm
176 selct_to
177 selintr
178 sema
179 semaerr
180 semaping
181 sendzlf
182 server_test
183 servr_kk
184 servr_uk
185 servr_ku
186 servr_uu
187 short_thread
188 sigpipe
189 sockping
190 sprintf
191 stack
192 stdio
193 str2addr
194 strod
195 switch
196 system
197 testbit
198 testfile
199 threads
200 timemac
201 timetest
203 udpsrv
204 version
205 writev
206 xnotify
207 zerolen"
209 rval=0
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
216 # don't timeout.
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
220 # test. (lth).
224 OS_PLATFORM=`uname`
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
231 for prog in $TESTS
233 printf "$prog (`date +%T`)"
234 printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
235 ./$prog >> ${LOGFILE} 2>&1
236 if [ 0 = $? ] ; then
237 printf "\t\t\tPassed\n";
238 else
239 printf "\t\t\tFAILED\n";
240 rval=1
242 printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
243 done
244 else
245 for prog in $TESTS
247 printf "$prog (`date +%T`)"
248 printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
249 export test_rval
250 ./$prog >> ${LOGFILE} 2>&1 &
251 test_pid=$!
252 sleep_pid=0
253 if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
254 then
255 (sleep $TEST_TIMEOUT; kill $test_pid >/dev/null 2>&1 ) &
256 sleep_pid=$!
258 wait $test_pid
259 test_rval=$?
260 [ $sleep_pid -eq 0 ] || kill $sleep_pid >/dev/null 2>&1
261 if [ 0 = $test_rval ] ; then
262 printf "\t\t\tPassed\n";
263 else
264 printf "\t\t\tFAILED\n";
265 rval=1
267 printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
268 done
271 if [ $rval -ne 0 ]; then
272 cat ${LOGFILE}
275 printf "END\t\t\t`date`\n"
276 exit $rval