[cfe-commits] r67610 - /cfe/trunk/test/TestRunner.sh
Daniel Dunbar
daniel at zuster.org
Mon Mar 23 23:17:45 PDT 2009
Author: ddunbar
Date: Tue Mar 24 01:17:45 2009
New Revision: 67610
URL: http://llvm.org/viewvc/llvm-project?rev=67610&view=rev
Log:
Update TestRunner.sh for renaming.
- Substitutes both clang and clang-cc.
- Incorporates patch from Jon Simons to diagnose if clang or clang-cc
isn't found.
- Uses full path when running scripts, for more precision in the
output.
Modified:
cfe/trunk/test/TestRunner.sh
Modified: cfe/trunk/test/TestRunner.sh
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/TestRunner.sh?rev=67610&r1=67609&r2=67610&view=diff
==============================================================================
--- cfe/trunk/test/TestRunner.sh (original)
+++ cfe/trunk/test/TestRunner.sh Tue Mar 24 01:17:45 2009
@@ -43,16 +43,40 @@
if [ ! -n "$CLANG" ]; then
CLANG="clang"
fi
+
+# Resolve the path, and Make sure $CLANG actually exists; otherwise
+# ensuing failures are non-obvious.
+CLANG=$(which "$CLANG")
+if [ -z $CLANG ]; then
+ echo "Couldn't find 'clang' program, try setting CLANG in your environment"
+ exit 1
+fi
+
if [ -n "$VG" ]; then
rm -f $OUTPUT.vg
CLANG="valgrind --leak-check=full --quiet --log-file=$OUTPUT.vg $CLANG"
fi
+# Assuming $CLANG is correct, use it to derive clang-cc. We expect to
+# be looking in a build directory, so just add '-cc'.
+CLANGCC=$CLANGCC
+if [ ! -n "$CLANGCC" ]; then
+ CLANGCC="$CLANG-cc"
+fi
+
+# Try to sanity check $CLANGCC too
+CLANGCC=$(which "$CLANGCC")
+if [ -z "$CLANGCC" ]; then
+ echo "Couldn't find 'clang-cc' program, make sure clang is found in your build directory"
+ exit 1
+fi
+
SCRIPT=$OUTPUT.script
TEMPOUTPUT=$OUTPUT.tmp
grep 'RUN:' $FILENAME | \
sed -e "s|^.*RUN:\(.*\)$|\1|g" \
- -e "s|clang|$CLANG|g" \
+ -e "s| clang | $CLANG |g" \
+ -e "s| clang-cc | $CLANGCC |g" \
-e "s|%s|$SUBST|g" \
-e "s|%prcontext|prcontext.tcl|g" \
-e "s|%t|$TEMPOUTPUT|g" > $SCRIPT
More information about the cfe-commits
mailing list