Skip to content

Commit

Permalink
litsupport-tests: Cleanup, do not hardcode lit path/name
Browse files Browse the repository at this point in the history
llvm-svn: 266785
  • Loading branch information
MatzeB committed Apr 19, 2016
1 parent 934ce54 commit 7dcf543
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions litsupport-tests/run.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
#!/bin/bash
set -u
TOP_OUTPUT="/tmp/litoutput"
rm -rf "$TOP_OUTPUT"
mkdir -p "$TOP_OUTPUT"

if [ -z "${1:-}" ]; then
echo "Usage: $0 /path/to/lit"
exit 1
fi
LIT="$1"

function run_tests {
OUTPUT="$TOP_OUTPUT/$DIR"
LIT_EXE="$1"
rm -rf "$OUTPUT"
mkdir -p "$OUTPUT"

echo "Running lit"
LITFLAGS=""
if [ -e litflags.txt ]; then
LITFLAGS="$(cat litflags.txt)"
fi
$LIT . -j 1 $LITFLAGS -o "$OUTPUT/result.json" >& "$OUTPUT/lit.out"
CMD="$LIT_EXE . -j 1 $LITFLAGS -o \"$OUTPUT/result.json\" >& \"$OUTPUT/lit.out\""
echo " $CMD"
eval $CMD
for f in check/*; do
BASE="$(basename "$f")"
echo "Checking litoutput/$BASE ($f)"
cat $OUTPUT/$BASE | FileCheck "$f"
CMD="cat $OUTPUT/$BASE | FileCheck \"$f\""
echo " $CMD"
eval $CMD
done
}

Expand All @@ -26,12 +36,10 @@ for i in */lit.site.cfg; do
pushd "$DIR" > /dev/null

echo "===> $DIR/python2.7"
LIT="python2.7 $(which pullvm-lit)"
run_tests
run_tests "python2.7 $LIT"

echo "===> $DIR/python3"
LIT="python3 $(which pullvm-lit)"
run_tests
run_tests "python3 $LIT"

popd > /dev/null
done

0 comments on commit 7dcf543

Please sign in to comment.