added a few more tests and Makefiles to automate them
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@336 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
		
							
								
								
									
										13
									
								
								testing/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								testing/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
|  | ||||
| .SILENT: | ||||
|  | ||||
| all: | ||||
| 	echo "Testing CPUs..." | ||||
| 	echo | ||||
| 	make -C cpus | ||||
| 	echo "Testing errors..." | ||||
| 	echo | ||||
| 	make -C errors | ||||
| 	echo "Testing warnings..." | ||||
| 	echo | ||||
| 	make -C warnings | ||||
							
								
								
									
										17
									
								
								testing/cpus/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								testing/cpus/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| ACMEFLAGS	= -v0 | ||||
| CPUS	:= $(subst .a,,$(subst test-,,$(wildcard test-*.a))) | ||||
| FILES	= $(foreach N,$(CPUS),$(N).o) | ||||
|  | ||||
| .SILENT: | ||||
|  | ||||
| %.o: test-%.a | ||||
| 	echo "Testing CPU:" $(subst .o,,$@) | ||||
| 	acme $(ACMEFLAGS) -o test.o $< | ||||
| 	cmp test.o expected-$@ | ||||
| 	rm test.o | ||||
| 	echo "Ok." | ||||
|  | ||||
| all: $(FILES) | ||||
| 	echo | ||||
| 	echo "Testing CPUs: PASSED" | ||||
| 	echo | ||||
| @@ -1,8 +0,0 @@ | ||||
| #!/bin/bash | ||||
| for CPU in 6502 65c02 r65c02 w65c02 nmos6502 c64dtv2 65ce02 4502 m65 65816 ; do | ||||
| 	acme -v0 test-"$CPU".a || exit | ||||
| 	cmp out-"$CPU".o expected-"$CPU".o || exit | ||||
| done | ||||
| echo | ||||
| echo "All CPU tests passed successfully." | ||||
| echo | ||||
							
								
								
									
										15
									
								
								testing/errors/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								testing/errors/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| ACMEFLAGS	= -v0 | ||||
| FILES	:= $(wildcard *.a) | ||||
| TESTS	= $(subst .a,.test,$(FILES)) | ||||
|  | ||||
| .SILENT: | ||||
|  | ||||
| %.test: %.a | ||||
| 	echo "Testing error generation:" $< | ||||
| 	! acme $(ACMEFLAGS) $< | ||||
| 	echo "Ok." | ||||
|  | ||||
| all: $(TESTS) | ||||
| 	echo | ||||
| 	echo "Testing errors: PASSED" | ||||
| 	echo | ||||
							
								
								
									
										1
									
								
								testing/errors/opnotsupp2.a
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								testing/errors/opnotsupp2.a
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| 	a = 3 != []	; -> "Operation not supported." | ||||
							
								
								
									
										1
									
								
								testing/errors/opnotsupp3.a
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								testing/errors/opnotsupp3.a
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| 	b = "str" = []	; -> "Operation not supported." | ||||
							
								
								
									
										1
									
								
								testing/errors/opnotsupp4.a
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								testing/errors/opnotsupp4.a
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| 	c = [] + 3	; -> "Operation not supported." | ||||
							
								
								
									
										2
									
								
								testing/errors/valuenotdefined3.a
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								testing/errors/valuenotdefined3.a
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| 	* = $200 | ||||
| 	!by .local	; -> "Value not defined." | ||||
							
								
								
									
										2
									
								
								testing/errors/valuenotdefined4.a
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								testing/errors/valuenotdefined4.a
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| 	* = $200 | ||||
| 	!by @cheap_local	; -> "Value not defined." | ||||
							
								
								
									
										21
									
								
								testing/warnings/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								testing/warnings/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| ACMEFLAGS	= -v0 | ||||
| FILES		:= $(wildcard *.a) | ||||
| FAILTESTS	= $(subst .a,.fail,$(FILES)) | ||||
| SUCCTESTS	= $(subst .a,.succ,$(FILES)) | ||||
|  | ||||
| .SILENT: | ||||
|  | ||||
| %.fail: %.a | ||||
| 	echo "Testing warning with --strict:" $< | ||||
| 	! acme $(ACMEFLAGS) --strict $< | ||||
| 	echo "Ok." | ||||
|  | ||||
| %.succ: %.a | ||||
| 	echo "Testing warning:" $< | ||||
| 	acme $(ACMEFLAGS) $< | ||||
| 	echo "Ok." | ||||
|  | ||||
| all: $(FAILTESTS) $(SUCCTESTS) | ||||
| 	echo | ||||
| 	echo "Testing warnings: PASSED" | ||||
| 	echo | ||||
							
								
								
									
										2
									
								
								testing/warnings/initmem.a
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								testing/warnings/initmem.a
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| 	!initmem 0 | ||||
| 	!initmem 0	; -> "Memory already initialised." | ||||
							
								
								
									
										6
									
								
								testing/warnings/limit.a
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								testing/warnings/limit.a
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| 	*=$1000 | ||||
| 	!tx "Hinz" | ||||
| 	!outfilelimit | ||||
| 	!tx "Kunz" | ||||
| 	!outfilelimit	; -> "End of output file already chosen." | ||||
| 	!tx "Bla" | ||||
							
								
								
									
										6
									
								
								testing/warnings/segment1.a
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								testing/warnings/segment1.a
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| 	*=$1000 | ||||
| 		clc | ||||
| 		nop | ||||
| 		rts | ||||
| 	*=$1001 | ||||
| 		brk	; -> "Segment starts inside another one, overwriting it." | ||||
							
								
								
									
										6
									
								
								testing/warnings/segment2.a
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								testing/warnings/segment2.a
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| 	*=$1001 | ||||
| 		brk | ||||
| 	*=$1000 | ||||
| 		clc | ||||
| 		nop	; -> "Segment reached another one, overwriting it." | ||||
| 		rts | ||||
							
								
								
									
										6
									
								
								testing/warnings/start.a
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								testing/warnings/start.a
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| 	*=$1000 | ||||
| 	!tx "Hinz" | ||||
| 	!outfilestart | ||||
| 	!tx "Kunz" | ||||
| 	!outfilestart	; -> "Start of output file already chosen." | ||||
| 	!tx "Bla" | ||||
		Reference in New Issue
	
	Block a user