-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-helloworld.sh
More file actions
executable file
·43 lines (35 loc) · 951 Bytes
/
Copy pathtest-helloworld.sh
File metadata and controls
executable file
·43 lines (35 loc) · 951 Bytes
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
#!/bin/bash
# Author: Bowen (bm2734), Yunxuan (ys3065)
files="helloworld_tests/test-helloworld-*.xpp"
TOPLEVEL="./toplevel.native"
CC="clang"
CFLAGS="-Wall"
Check() {
basename=`echo $1 | sed 's/.*\\///
s/.xpp//'`
reffile=`echo $1 | sed 's/.xpp$//'`
basedir="`echo $1 | sed 's/\/[^\/]*$//'`/."
echo "Testing ${basename}..."
$TOPLEVEL -l $1 > ${reffile}.ll
${CC} ${CFLAGS} ${reffile}.ll -o ${reffile}
./${reffile} > ${basename}.out
if diff -bB ${basename}.out ${reffile}.out > ${basename}.diff
then
echo "Test passed."
else
echo "Test failed."
diff -bB ${basename}.out ${reffile}.out
fi
rm -f ${reffile}.ll ${reffile} ${basename}.out ${basename}.diff
}
for file in $files
do
case $file in
*test-helloworld-*)
Check $file
;;
*)
echo "unknown file type $file"
;;
esac
done