-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrun_all.sh
36 lines (35 loc) · 794 Bytes
/
run_all.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
#!/bin/bash
for i in /usr/local/l2p/power/power*.o
do
test=`basename $i | sed 's/power//' | sed 's/.o//'`
if [ "$test" == "" ]
then
echo "**Testing correct implementation **"
else
echo "**Testing broken implementation ${test} **"
fi
echo "-------------------------------------"
echo ""
gcc -o test-power test-power.c $i
if [ "$?" != "0" ]
then
echo "Could not compile test-power.c with $i" > /dev/stderr
exit 1
fi
./test-power
if [ "$?" != 0 ]
then
if [ "$test" == "" ]
then
echo "Your test program falsely failed the correct implementation!" > /dev/stderr
exit 1
fi
else
if [ "$test" != "" ]
then
echo "Your test program did not identify $i as broken!" > /dev/stderr
exit 1
fi
fi
echo ""
done