Makefile

changeset 65
7dd4fd1e7071
parent 64
60decfc9ad13
child 67
5da2cb5aea6b
--- a/Makefile	Mon Oct 03 12:27:10 2022 +0200
+++ b/Makefile	Mon Oct 03 12:56:28 2022 +0200
@@ -47,23 +47,37 @@
 	
 build:
 	$(MKDIR) $@
-	
-test: all
-	./build/$(BIN) test/ctestfile.c -o build/ctest.html \
-	-H test/header.html -F test/footer.html
-	./build/$(BIN) -j test/javatestfile.java -o build/javatest.html \
-	-H test/jheader.html -F test/footer.html
-	./build/$(BIN) test/bigtestfile.c -o build/bigtest.html \
-	-H test/header.html -F test/footer.html
-	./build/$(BIN) -p test/plain.csp -o build/plain.html \
-	-H test/header.html -F test/footer.html
-	./build/$(BIN) -p test/emptyfile.c -o build/emptyfile.html \
-    	-H test/header.html -F test/footer.html
-	diff build/ctest.html test/golden-master/ctest.html && \
-	diff build/javatest.html test/golden-master/javatest.html && \
-	diff build/bigtest.html test/golden-master/bigtest.html && \
-	diff build/plain.html test/golden-master/plain.html && \
-	diff build/emptyfile.html test/golden-master/emptyfile.html
+
+test-c: all
+	for f in ctest bigtest empty ; do \
+  		echo "test/$$f.c" ; \
+  		./build/$(BIN) -o "build/$$f.html" \
+        	-H test/header.html \
+        	-F test/footer.html \
+        	"test/$$f.c" && \
+        diff "build/$$f.html" "test/golden-master/$$f.html" ; \
+    done
+
+test-java: all
+	for f in javatest ; do \
+  		./build/$(BIN) -j -o "build/$$f.html" \
+        	-H test/jheader.html \
+        	-F test/footer.html \
+        	"test/$$f.java" && \
+        diff "build/$$f.html" "test/golden-master/$$f.html" ; \
+    done
+
+test-plain: all
+	for f in plain ; do \
+  		./build/$(BIN) -p -o "build/$$f.html" \
+        	-H test/header.html \
+        	-F test/footer.html \
+        	"test/$$f.txt" && \
+        diff "build/$$f.html" "test/golden-master/$$f.html" ; \
+    done
+
+test: test-c test-java test-plain
+	@echo "Tests successful."
 	
 clean:
 	$(RM) $(RMFLAGS) build

mercurial