Skip to content

Commit 904f1c8

Browse files
committed
Tweak test running script
1 parent 1ae78b4 commit 904f1c8

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

run_tests

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,30 +43,29 @@ else
4343
fi
4444

4545
# Run tests
46-
cd "$RESDIR/$TARGET" # change dir for ease of use
4746
for i in $(ls "$TESTDIR/$SUITE"*.xpl); do
4847
test_name="$(basename $i)"
4948
test_name="${test_name%.xpl}"
5049

5150
echo "Running $test_name.."
52-
"$SRCDIR"/xpl --target $TARGET -o "$test_name.$TARGET" $i
51+
"$SRCDIR"/xpl --target $TARGET -o "$RESDIR/$TARGET/$test_name.$TARGET" $i
5352

5453
if [ $TARGET = "xml" ]; then
55-
java -cp "$SRCDIR"/xml2dot.jar xml2dot.xml2dot "$test_name.xml"
54+
java -cp "$SRCDIR"/xml2dot.jar xml2dot.xml2dot "$RESDIR/xml/$test_name.xml"
5655
ps aux | grep dotty | head -n1 | kill $(awk '{print $2}')
57-
dot -Tpng -o "img/$test_name.png" "$test_name.xml.dot"
56+
dot -Tpng -o "$RESDIR/xml/img/$test_name.png" "$RESDIR/xml/$test_name.xml.dot"
5857
else
59-
yasm -felf32 -o "$test_name.o" "$test_name.asm"
60-
ld -melf_i386 -o "$test_name" "$test_name.o" -lrts
61-
chmod +x "$test_name"
62-
./$test_name > "out/$test_name.out"
63-
rm -f "$test_name"
58+
yasm -felf32 -o "$RESDIR/asm/$test_name.o" "$RESDIR/asm/$test_name.asm"
59+
ld -melf_i386 -o "$RESDIR/asm/$test_name" "$RESDIR/asm/$test_name.o" -lrts
60+
chmod +x "$RESDIR/asm/$test_name"
61+
"$RESDIR/asm/"$test_name > "$RESDIR/asm/out/$test_name.out"
62+
rm -f "$RESDIR/asm/$test_name"
6463
fi
6564
done
6665

6766
if [ $TARGET = "xml" ]; then
68-
rm -rf *.xml.dot
67+
rm -rf "$RESDIR/xml/"*.xml.dot
6968
else
70-
rm -rf *.o
69+
rm -rf "$RESDIR/asm/"*.o
7170
fi
7271

0 commit comments

Comments
 (0)