mirror of
https://github.com/uffejakobsen/acme.git
synced 2024-12-22 18:30:44 +00:00
more test files
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@342 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
parent
36653b8cf1
commit
58b04ba77c
22
testing/auto/iterables.a
Normal file
22
testing/auto/iterables.a
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
!macro a @r {
|
||||
!if @r != 1 {
|
||||
!error "assertion failed"
|
||||
}
|
||||
}
|
||||
|
||||
squares = [1, 4, 9]
|
||||
emptylist = []
|
||||
primes = [2, 3, 5, 7]
|
||||
+a primes + emptylist + squares == [2,3,5,7,1,4,9]
|
||||
|
||||
somestring = "Arthur"
|
||||
emptystring = ""
|
||||
otherstring = "Ford"
|
||||
+a otherstring + emptystring + somestring == "FordArthur"
|
||||
|
||||
collection = []
|
||||
!for c in "Trillian" {
|
||||
!set collection = collection + [c]
|
||||
}
|
||||
+a collection == [84, 114, 105, 108, 108, 105, 97, 110]
|
36
testing/auto/postfix.a
Normal file
36
testing/auto/postfix.a
Normal file
@ -0,0 +1,36 @@
|
||||
!macro a @r {
|
||||
!if @r != 1 {
|
||||
!error "postfix did not work"
|
||||
}
|
||||
}
|
||||
*=$1000
|
||||
a = 3
|
||||
a+2 = 3 ; symbol has not been read, so adding postfix should work
|
||||
label
|
||||
label+2 ; label has not been read, so adding postfix should work
|
||||
!set b+2 = 17
|
||||
label2
|
||||
lda b
|
||||
+a * - label2 == 3
|
||||
label3
|
||||
!for c+2, 17, 17 {
|
||||
lda c
|
||||
}
|
||||
+a * - label3 == 3
|
||||
d+2 = 17
|
||||
!set d+2 = 17
|
||||
label4
|
||||
lda d
|
||||
+a * - label4 == 3
|
||||
label5
|
||||
e+2=5
|
||||
!for e+2, 17, 17 {
|
||||
lda e
|
||||
}
|
||||
+a * - label5 == 3
|
||||
label6
|
||||
f+3 = 17
|
||||
!for g+2, f, f {
|
||||
lda g
|
||||
}
|
||||
+a * - label6 == 3
|
@ -9,6 +9,6 @@ all: outformats
|
||||
echo "Testing cliargs: PASSED"
|
||||
echo
|
||||
|
||||
outformats: outformats.a outformats.sh outformat-*.o
|
||||
outformats: outformats.a outformats.sh outformat-*.exp
|
||||
echo "Testing output formats:"
|
||||
bash outformats.sh
|
||||
|
BIN
testing/cliargs/outformat-apple.exp
Normal file
BIN
testing/cliargs/outformat-apple.exp
Normal file
Binary file not shown.
Binary file not shown.
BIN
testing/cliargs/outformat-cbm.exp
Normal file
BIN
testing/cliargs/outformat-cbm.exp
Normal file
Binary file not shown.
Binary file not shown.
BIN
testing/cliargs/outformat-plain.exp
Normal file
BIN
testing/cliargs/outformat-plain.exp
Normal file
Binary file not shown.
@ -1 +0,0 @@
|
||||
<EFBFBD>`
|
@ -10,5 +10,5 @@
|
||||
!error "unexpected FORMAT"
|
||||
}
|
||||
*=$1000
|
||||
lda #1
|
||||
lda #0
|
||||
rts
|
||||
|
@ -10,18 +10,18 @@ check() {
|
||||
}
|
||||
|
||||
# if neither -o nor -f are given, use format from "!to", which defaults to cbm:
|
||||
check outformat-cbm.o -DFORMAT=0
|
||||
check outformat-plain.o -DFORMAT=1
|
||||
check outformat-cbm.o -DFORMAT=2
|
||||
check outformat-apple.o -DFORMAT=3
|
||||
check outformat-cbm.exp -DFORMAT=0
|
||||
check outformat-plain.exp -DFORMAT=1
|
||||
check outformat-cbm.exp -DFORMAT=2
|
||||
check outformat-apple.exp -DFORMAT=3
|
||||
|
||||
# if -o or -f are given, format from "!to" should be ignored:
|
||||
for f in 0 1 2 3 ; do
|
||||
check outformat-plain.o -DFORMAT=$f -f plain
|
||||
check outformat-cbm.o -DFORMAT=$f -f cbm
|
||||
check outformat-apple.o -DFORMAT=$f -f apple
|
||||
check outformat-plain.o -DFORMAT=$f -o test.o # defaults to plain
|
||||
check outformat-plain.o -DFORMAT=$f -o test.o -f plain
|
||||
check outformat-cbm.o -DFORMAT=$f -o test.o -f cbm
|
||||
check outformat-apple.o -DFORMAT=$f -o test.o -f apple
|
||||
check outformat-plain.exp -DFORMAT=$f -f plain
|
||||
check outformat-cbm.exp -DFORMAT=$f -f cbm
|
||||
check outformat-apple.exp -DFORMAT=$f -f apple
|
||||
check outformat-plain.exp -DFORMAT=$f -o test.o # defaults to plain
|
||||
check outformat-plain.exp -DFORMAT=$f -o test.o -f plain
|
||||
check outformat-cbm.exp -DFORMAT=$f -o test.o -f cbm
|
||||
check outformat-apple.exp -DFORMAT=$f -o test.o -f apple
|
||||
done
|
||||
|
@ -1,13 +1,13 @@
|
||||
ACMEFLAGS = -v0
|
||||
CPUS := $(subst .a,,$(subst test-,,$(wildcard test-*.a)))
|
||||
FILES = $(foreach N,$(CPUS),$(N).o)
|
||||
FILES = $(foreach N,$(CPUS),$(N).exp)
|
||||
|
||||
.SILENT:
|
||||
|
||||
%.o: test-%.a
|
||||
echo "Testing CPU:" $(subst .o,,$@)
|
||||
%.exp: test-%.a
|
||||
echo "Testing CPU:" $(subst .exp,,$@)
|
||||
acme $(ACMEFLAGS) -o test.o $<
|
||||
cmp test.o expected-$@
|
||||
cmp test.o out-$@
|
||||
$(RM) test.o
|
||||
echo "Ok."
|
||||
|
||||
|
2
testing/errors/stringlength1.a
Normal file
2
testing/errors/stringlength1.a
Normal file
@ -0,0 +1,2 @@
|
||||
*=$1000
|
||||
lda #"" ; -> "String length is not 1."
|
2
testing/errors/stringlength2.a
Normal file
2
testing/errors/stringlength2.a
Normal file
@ -0,0 +1,2 @@
|
||||
*=$1000
|
||||
lda #"aa" ; -> "String length is not 1."
|
Loading…
Reference in New Issue
Block a user