-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathruntests.sh
More file actions
executable file
·145 lines (129 loc) · 3.4 KB
/
runtests.sh
File metadata and controls
executable file
·145 lines (129 loc) · 3.4 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/sh
if [ "$1" != "" ]; then
SPIN2CPP=$1
FASTSPIN="$1 --asm --binary --code=hub"
else
SPIN2CPP=../${BUILD:='./build'}/spin2cpp
FASTSPIN="../${BUILD:='./build'}/flexspin -g -q"
fi
PROG_C="$SPIN2CPP -I../Lib"
PROG_ASM="$FASTSPIN -I../Lib"
#LOADP2="loadp2 -b230400"
LOADP2="propeller-load -r"
LOADP1="propeller-load -r"
CC=propeller-elf-gcc
ok="ok"
endmsg=$ok
#
# run tests on the propeller itself
#
echo "running tests on propeller..."
#
# BASIC tests; C++ support is still incomplete
#
for i in basexec*.bas
do
j=`basename $i .bas`
# if $PROG_C --binary --ctypes --gas -fpermissive -Os -o $j.binary $i; then
# rm -f $j.out
# propeller-load $j.binary -r -t -q > $j.out
# fi
# # the --lines=+6 skips the first 6 lines that propeller-load printed
# tail --lines=+6 $j.out >$j.txt
# if diff -ub Expect/$j.txt $j.txt
# then
# echo $j passed for C++
# rm -f $j.out $j.txt $j.binary $j.cpp $j.h FullDuplexSerial.cpp FullDuplexSerial.h dattest.cpp dattest.h
# else
# echo $j failed
# endmsg="TEST FAILURES"
# fi
# now compile with asm
if $PROG_ASM -o $j.binary $i; then
$LOADP2 $j.binary -t -q > $j.out
fi
# the --lines=+6 skips the first 6 lines that propeller-load printed
tail --lines=+6 $j.out >$j.txt
if diff -ub Expect/$j.txt $j.txt
then
echo $j passed for ASM
rm -f $j.out $j.txt $j.binary $j.pasm
else
echo $j failed
endmsg="TEST FAILURES"
fi
done
#
# C tests; obviously no need to test conversion to C
#
for i in cexec*.c
do
j=`basename $i .c`
# if $PROG_C --binary --ctypes --gas -fpermissive -Os -o $j.binary $i; then
# rm -f $j.out
# propeller-load $j.binary -r -t -q > $j.out
# fi
# # the --lines=+6 skips the first 6 lines that propeller-load printed
# tail --lines=+6 $j.out >$j.txt
# if diff -ub Expect/$j.txt $j.txt
# then
# echo $j passed for C++
# rm -f $j.out $j.txt $j.binary $j.cpp $j.h FullDuplexSerial.cpp FullDuplexSerial.h dattest.cpp dattest.h
# else
# echo $j failed
# endmsg="TEST FAILURES"
# fi
# now compile with asm
if $PROG_ASM -o $j.binary $i; then
$LOADP2 $j.binary -t -q > $j.out
fi
# the --lines=+6 skips the first 6 lines that propeller-load printed
tail --lines=+6 $j.out >$j.txt
if diff -ub Expect/$j.txt $j.txt
then
echo $j passed for ASM
rm -f $j.out $j.txt $j.binary $j.pasm
else
echo $j failed
endmsg="TEST FAILURES"
fi
done
#
# Spin tests
#
for i in exec*.spin
do
j=`basename $i .spin`
j=`basename $j .bas`
if $PROG_C --binary --ctypes --gas -fpermissive -Os -o $j.binary $i; then
rm -f $j.out
$LOADP1 $j.binary -t -q > $j.out
fi
# the --lines=+6 skips the first 6 lines that propeller-load printed
tail --lines=+6 $j.out >$j.txt
if diff -ub Expect/$j.txt $j.txt
then
echo $j passed for C++
rm -f $j.out $j.txt $j.binary $j.cpp $j.h FullDuplexSerial.cpp FullDuplexSerial.h dattest.cpp dattest.h setabort.cpp setabort.h
else
echo $j failed
endmsg="TEST FAILURES"
fi
# now compile with asm
if $PROG_ASM -o $j.binary $i; then
$LOADP2 $j.binary -t -q > $j.out
fi
# the --lines=+6 skips the first 6 lines that propeller-load printed
tail --lines=+6 $j.out >$j.txt
if diff -ub Expect/$j.txt $j.txt
then
echo $j passed for ASM
rm -f $j.out $j.txt $j.binary $j.pasm
else
echo $j failed
endmsg="TEST FAILURES"
fi
done
# clean up
rm -f FullDuplexSerial.cpp FullDuplexSerial.h
echo $endmsg