shithub: scc

Download patch

ref: d6e81805c12bf44489eacd53d112c0382f1bc52b
parent: 66b39b58b8cda3e3c3a86c23401cad0e670a3432
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Jul 1 15:22:31 EDT 2022

tests: Make easier to execute the full set of tests

There are some tests that require external tools installed
and it makes imposible to execute the tests in normal
systems without these custom tools. As a first step we can
skip the tests that are failing.

--- a/tests/as/execute/test.sh
+++ b/tests/as/execute/test.sh
@@ -25,7 +25,7 @@
 nl -b a > $tmp1
 
 
-objdump |
+scc-objdump |
 sed -n '/^data:/,$ {
 	/^data:/ ! {
 		s%.*:%%
--- a/tests/ld/execute/Makefile
+++ b/tests/ld/execute/Makefile
@@ -7,7 +7,14 @@
 OBJS   = f1.o f2.o
 OBJLIB = f3.o
 
-all test: a.out
+all:
+	@if $(AS) /dev/null 2>/dev/null;\
+	then\
+		$(MAKE) test;\
+	fi
+
+
+tests: a.out
 
 a.out: $(OBJS) f.a
 	$(LD) $(OBJS) f.a
--- a/tests/nm/execute/Makefile
+++ b/tests/nm/execute/Makefile
@@ -3,14 +3,19 @@
 ROOT=../../..
 
 OUT = z80.out
+AS = z80-unknown-coff-as
 
-all: tests
+all:
+	@if $(AS) 2>/dev/null;\
+	then\
+		$(MAKE) tests;\
+	fi
 
 tests: $(OUT)
 	@PATH=$(ROOT)/bin:$$PATH:. chktest.sh
 
 z80.out: master.s
-	z80-unknown-coff-as -o $@ master.s
+	$(AS) -o $@ master.s
 
 clean:
 	rm -f *.a *.out test.log
--- a/tests/size/execute/Makefile
+++ b/tests/size/execute/Makefile
@@ -2,12 +2,17 @@
 
 ROOT=../../..
 
+AS = z80-unknown-coff-as
 OUT = z80.out
 
-all: tests
+all:
+	@if $(AS) /dev/null 2>/dev/null;\
+	then\
+		$(MAKE) tests;\
+	fi
 
 tests: $(OUT)
-	@PATH=$(ROOT)/bin:$$PATH:. chktest.sh
+	@PATH=$(ROOT)/bin:$$PATH:. chktest.sh;\
 
 z80.out: master.s
 	z80-unknown-coff-as -o $@ master.s
--- a/tests/strip/execute/Makefile
+++ b/tests/strip/execute/Makefile
@@ -3,14 +3,19 @@
 ROOT=../../..
 
 OUT = z80.out
+AS = z80-unknown-coff-as
 
-all: tests
+all:
+	@if $(AS) 2>/dev/null;\
+	then\
+		$(MAKE) tests;\
+	fi
 
 tests: $(OUT)
 	@PATH=$(ROOT)/bin:$$PATH:. chktest.sh
 
 z80.out: master.s
-	z80-unknown-coff-as -o $@ master.s
+	$(AS) -o $@ master.s
 
 clean:
 	rm -f *.a *.out test.log