2 # //===--------------------------- testit ---------------------------------===//
4 # // The LLVM Compiler Infrastructure
6 # // This file is distributed under the University of Illinois Open Source
7 # // License. See LICENSE.TXT for details.
9 # //===--------------------------------------------------------------------===//
13 currentdir
=`basename $currentpath`
14 while [ $currentdir != "test" ]; do
15 if [ $currentdir = "/" ]
17 echo "current directory must be in or under \"test\"."
22 currentdir
=`basename $currentpath`
31 if which xcrun
>/dev
/null
41 OPTIONS
="-std=c++11 -stdlib=libc++"
43 OPTIONS
="$OPTIONS -I$LIBCXX_ROOT/test/support"
45 if [ -z "$HEADER_INCLUDE" ]
47 HEADER_INCLUDE
="-I$LIBCXX_ROOT/include"
50 if [ -z "$SOURCE_LIB" ]
52 SOURCE_LIB
="-L$LIBCXX_ROOT/lib"
56 *-*-mingw* |
*-*-cygwin* |
*-*-win*)
66 THREAD_FLAGS
=-lpthread
79 if (ls *.fail.cpp
> /dev
/null
2>&1)
81 for FILE
in $
(ls *.fail.cpp
); do
82 if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS -o .
/$TEST_EXE > /dev
/null
2>&1
85 echo "$FILE should not compile"
93 if (ls *.pass.cpp
> /dev
/null
2>&1)
95 for FILE
in $
(ls *.pass.cpp
); do
98 echo "Running test: " $FILE
100 if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS $
(test $1 = no ||
echo $THREAD_FLAGS) -o .
/$TEST_EXE
107 echo "`pwd`/$FILE failed at run time"
108 echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS $
(test $1 = no ||
echo $THREAD_FLAGS)
113 echo "`pwd`/$FILE failed to compile"
114 echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS $
(test $1 = no ||
echo $THREAD_FLAGS)
122 echo "failed $fail tests in `pwd`"
123 IMPLEMENTED_FAIL
=$
(($IMPLEMENTED_FAIL+1))
127 echo "passed $pass tests in `pwd`"
130 IMPLEMENTED_PASS
=$
((IMPLEMENTED_PASS
+1))
133 if [ $fail -eq 0 -a $pass -eq 0 ]
135 echo "not implemented: `pwd`"
136 UNIMPLEMENTED
=$
(($UNIMPLEMENTED+1))
139 FAIL
=$
(($FAIL+$fail))
140 PASS
=$
(($PASS+$pass))
147 if [ $FILE = thread
-o $1 = yes ]; then
159 echo "****************************************************"
160 echo "Results for `pwd`:"
161 echo "using `$CC --version`"
162 echo "with $OPTIONS $HEADER_INCLUDE $SOURCE_LIB"
163 echo "----------------------------------------------------"
164 echo "sections without tests : $UNIMPLEMENTED"
165 echo "sections with failures : $IMPLEMENTED_FAIL"
166 echo "sections without failures: $IMPLEMENTED_PASS"
168 echo "total number of sections : $(($UNIMPLEMENTED+$IMPLEMENTED_FAIL+$IMPLEMENTED_PASS))"
169 echo "----------------------------------------------------"
170 echo "number of tests failed : $FAIL"
171 echo "number of tests passed : $PASS"
173 echo "total number of tests : $(($FAIL+$PASS))"
174 echo "****************************************************"