[libcxxabi] r207907 - Don't use bash features.

Joerg Sonnenberger joerg at bec.de
Sat May 3 05:09:55 PDT 2014


Author: joerg
Date: Sat May  3 07:09:55 2014
New Revision: 207907

URL: http://llvm.org/viewvc/llvm-project?rev=207907&view=rev
Log:
Don't use bash features.

Modified:
    libcxxabi/trunk/test/testit

Modified: libcxxabi/trunk/test/testit
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/testit?rev=207907&r1=207906&r2=207907&view=diff
==============================================================================
--- libcxxabi/trunk/test/testit (original)
+++ libcxxabi/trunk/test/testit Sat May  3 07:09:55 2014
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # //===--------------------------- testit ---------------------------------===//
 # //
 # //                     The LLVM Compiler Infrastructure
@@ -8,7 +8,7 @@
 # //
 # //===--------------------------------------------------------------------===//
 
-if [ -z $CC ]
+if [ -z "$CC" ]
 then
 	CC=clang++
 fi
@@ -33,25 +33,25 @@ UNIMPLEMENTED=0
 IMPLEMENTED_FAIL=0
 IMPLEMENTED_PASS=0
 
-function afunc
+afunc()
 {
 	fail=0
 	pass=0
-	if (ls *.fail.cpp &> /dev/null)
+	if (ls *.fail.cpp > /dev/null 2>&1)
 	then
 		for FILE in $(ls *.fail.cpp); do
-			if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS -o ./$TEST_EXE &> /dev/null
+			if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS -o ./$TEST_EXE > /dev/null 2>&1
 			then
 				rm ./$TEST_EXE
 				echo "$FILE should not compile"
-				let "fail+=1"
+				fail=$(($fail + 1))
 			else
-				let "pass+=1"
+				pass=$(($pass + 1))
 			fi
 		done
 	fi
 
-	if (ls *.cpp &> /dev/null)
+	if (ls *.cpp > /dev/null 2>&1)
 	then
 		for FILE in $(ls *.cpp); do
 			if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS -o ./$TEST_EXE
@@ -59,15 +59,15 @@ function afunc
 				if ./$TEST_EXE
 				then
 					rm ./$TEST_EXE
-					let "pass+=1"
+					pass=$(($pass + 1))
 				else
 					echo "$FILE failed at run time"
-					let "fail+=1"
+					fail=$(($fail + 1))
 					rm ./$TEST_EXE
 				fi
 			else
 				echo "$FILE failed to compile"
-				let "fail+=1"
+				fail=$(($fail + 1))
 			fi
 		done
 	fi
@@ -75,24 +75,24 @@ function afunc
 	if [ $fail -gt 0 ]
 	then
 		echo "failed $fail tests in `pwd`"
-		let "IMPLEMENTED_FAIL+=1"
+		IMPLEMENTED_FAIL=$(($IMPLEMENTED_FAIL + 1))
 	fi
 	if [ $pass -gt 0 ]
 	then
 		echo "passed $pass tests in `pwd`"
 		if [ $fail -eq 0 ]
 		then
-			let "IMPLEMENTED_PASS+=1"
+			IMPLEMENTED_PASS=$(($IMPLEMENTED_PASS + 1))
 		fi
 	fi
 	if [ $fail -eq 0 -a $pass -eq 0 ]
 	then
 		echo "not implemented:  `pwd`"
-		let "UNIMPLEMENTED+=1"
+		UNIMPLEMENTED=$(($UNIMPLEMENTED + 1))
 	fi
 
-	let "FAIL+=$fail"
-	let "PASS+=$pass"
+	FAIL=$(($FAIL + $fail))
+	PASS=$(($PASS + $pass))
 
 	for FILE in *
 	do





More information about the cfe-commits mailing list