forked from llvm/llvm-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·45 lines (38 loc) · 798 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/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"
LITFLAGS=""
if [ -e litflags.txt ]; then
LITFLAGS="$(cat litflags.txt)"
fi
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")"
CMD="cat $OUTPUT/$BASE | FileCheck \"$f\""
echo " $CMD"
eval $CMD
done
}
for i in */lit.site.cfg; do
DIR="$(dirname $i)"
pushd "$DIR" > /dev/null
echo "===> $DIR/python2.7"
run_tests "python2.7 $LIT"
echo "===> $DIR/python3"
run_tests "python3 $LIT"
popd > /dev/null
done