summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-24 06:17:45 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-24 06:17:45 +0000
commite494d340f481d55fc88b522be6833a1f7d71e28b (patch)
treec96faf06ecdcd9b8e0f77f98a1969dbb550630f1
parent91ea79dd3fdf0c3275cf2159c6a01c83e55bcdd3 (diff)
downloadclang-e494d340f481d55fc88b522be6833a1f7d71e28b.tar.gz
clang-e494d340f481d55fc88b522be6833a1f7d71e28b.tar.bz2
clang-e494d340f481d55fc88b522be6833a1f7d71e28b.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67610 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xtest/TestRunner.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/TestRunner.sh b/test/TestRunner.sh
index 8c355670ec..754ab30060 100755
--- a/test/TestRunner.sh
+++ b/test/TestRunner.sh
@@ -43,16 +43,40 @@ CLANG=$CLANG
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