[libcxx] r180942 - Make it possible to provide special (linker) flags for the thread tests.

Joerg Sonnenberger joerg at bec.de
Thu May 2 12:21:37 PDT 2013


Author: joerg
Date: Thu May  2 14:21:36 2013
New Revision: 180942

URL: http://llvm.org/viewvc/llvm-project?rev=180942&view=rev
Log:
Make it possible to provide special (linker) flags for the thread tests.
Use it to build & link against libpthread on NetBSD for tests iff they
are testing the thread interface.

Modified:
    libcxx/trunk/test/testit

Modified: libcxx/trunk/test/testit
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/testit?rev=180942&r1=180941&r2=180942&view=diff
==============================================================================
--- libcxx/trunk/test/testit (original)
+++ libcxx/trunk/test/testit Thu May  2 14:21:36 2013
@@ -61,6 +61,12 @@ case $TRIPLE in
     ;;
 esac
 
+case $(uname -s) in
+   NetBSD)
+     THREAD_FLAGS=-lpthread
+     ;;
+esac
+
 FAIL=0
 PASS=0
 UNIMPLEMENTED=0
@@ -91,7 +97,7 @@ afunc() {
             then
              	echo "Running test: " $FILE
             fi
-			if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS -o ./$TEST_EXE
+			if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS $(test $1 = no || echo $THREAD_FLAGS) -o ./$TEST_EXE
 			then
 				if ./$TEST_EXE
 				then
@@ -99,13 +105,13 @@ afunc() {
 					pass=$(($pass+1))
 				else
 					echo "`pwd`/$FILE failed at run time"
-					echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS
+					echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS $(test $1 = no || echo $THREAD_FLAGS)
 					fail=$(($fail+1))
 					rm ./$TEST_EXE
 				fi
 			else
 				echo "`pwd`/$FILE failed to compile"
-				echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS
+				echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS $(test $1 = no || echo $THREAD_FLAGS)
 				fail=$(($fail+1))
 			fi
 		done
@@ -138,13 +144,17 @@ afunc() {
 		if [ -d "$FILE" ];
 		then
 			cd $FILE
-			afunc
+			if [ $FILE = thread -o $1 = yes ]; then
+				afunc yes
+			else
+				afunc no
+			fi
 			cd ..
 		fi
 	done
 }
 
-afunc
+afunc no
 
 echo "****************************************************"
 echo "Results for `pwd`:"





More information about the cfe-commits mailing list