[libcxx] r180139 - Avoid bash specific functionality to work with any POSIX shell
Joerg Sonnenberger
joerg at bec.de
Tue Apr 23 12:53:24 PDT 2013
Author: joerg
Date: Tue Apr 23 14:53:24 2013
New Revision: 180139
URL: http://llvm.org/viewvc/llvm-project?rev=180139&view=rev
Log:
Avoid bash specific functionality to work with any POSIX shell
implementing $(( )).
Modified:
libcxx/trunk/test/testit
Modified: libcxx/trunk/test/testit
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/testit?rev=180139&r1=180138&r2=180139&view=diff
==============================================================================
--- libcxx/trunk/test/testit (original)
+++ libcxx/trunk/test/testit Tue Apr 23 14:53:24 2013
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# //===--------------------------- testit ---------------------------------===//
# //
# // The LLVM Compiler Infrastructure
@@ -67,25 +67,24 @@ 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 *.pass.cpp &> /dev/null)
+ if (ls *.pass.cpp > /dev/null 2>&1)
then
for FILE in $(ls *.pass.cpp); do
if [ "$VERBOSE" ]
@@ -97,17 +96,17 @@ function afunc
if ./$TEST_EXE
then
rm ./$TEST_EXE
- let "pass+=1"
+ pass=$(($pass+1))
else
echo "`pwd`/$FILE failed at run time"
echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS
- let "fail+=1"
+ 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
- let "fail+=1"
+ fail=$(($fail+1))
fi
done
fi
@@ -115,24 +114,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