]>
git.saurik.com Git - apple/libc.git/blob - tests/runtests
2 # Copyright 2009-2014 Apple Inc. All rights reserved.
5 BINDIR
="${BINDIR/%%*%%/.}"
7 # If not already set by bsdtesttool
8 if [ -z "$BSDTESTS_TMPDIR" ]; then
9 BSDTESTS_TMPDIR
="$(mktemp -d -t bsdtests)/"
10 export BSDTESTS_TMPDIR
11 echo "Using temp dir $BSDTESTS_TMPDIR"
15 T
="\"$BINDIR\"/bsdtestharness ./$1"
16 LOG
="${BSDTESTS_TMPDIR}$1${2:+.$2}"
17 SEP
="\n**** %-40s ****\n"
19 if [ -n "$BSDTESTS_STRESS" ]; then
21 while (( x
< BSDTESTS_STRESS
)); do
22 printf "$SEP" "$1 $2 stress $x"
23 eval $ENVIRON $T 2>&1 | tee -a "$LOG.$x.testlog"
28 eval $ENVIRON $T 2>&1 | tee -a "$LOG.testlog"
29 if [ -z "$BSDTESTS_PREBUILD" ]; then
30 printf "$SEP" "$1 debug $2"
31 eval $ENVIRON DYLD_IMAGE_SUFFIX
=_debug
$T 2>&1 | tee -a "$LOG.debuglog"
37 echo; echo " Libc test: $1 ..."
38 ENVIRON
="LIBDISPATCH_LOG=NO"
40 if [ -n "$(lipo -info /usr/lib/libSystem.dylib 2>&- | grep i386)" \
41 -a "$(sysctl -n hw.optional.x86_64 2>&-)" = "1" ]; then
42 ENVIRON
="$ENVIRON BSDTEST_ARCH=i386"
48 rm -f "${BSDTESTS_TMPDIR}"*.
{test,debug
,gctest
,gcdebug
,leaks
}log
50 if [ "$1" == "--nosummary" ]; then
54 if [ "$#" -gt 0 ]; then
55 if [ "$1" == "--help" ]; then
56 echo "Usage: $0 [--nosummary] [<test>|<test>|...]";
57 echo " --nosummary run all tests but do not summarize results at the end"
60 for T
in "$@"; do runtest
$T; done
62 for T
in $(cat test_list.txt); do runtest
$T; done
65 if [ -z "$NOSUMMARY" -a -x "$BINDIR"/bsdtestsummarize
]; then
67 cat "${BSDTESTS_TMPDIR}"*.
{test,debug
,gctest
,gcdebug
}log
| "$BINDIR"/bsdtestsummarize