Browse Source

Add verification makefile rule

Jeremy Soller 7 years ago
parent
commit
54655a4e3b
2 changed files with 24 additions and 6 deletions
  1. 1 0
      tests/.gitignore
  2. 23 6
      tests/Makefile

+ 1 - 0
tests/.gitignore

@@ -1,3 +1,4 @@
+/gen/
 /alloc
 /args
 /atof

+ 23 - 6
tests/Makefile

@@ -26,15 +26,32 @@ all: $(BINS)
 clean:
 	rm -f $(BINS) *.out
 
+run: $(BINS)
+	for bin in $(BINS); \
+	do
+		echo "# $${bin} #"; \
+		"./$${bin}" test args; \
+	done
+
 expected: $(BINS)
+	rm -rf expected
 	mkdir -p expected
-	for bin in $(BINS); do "./$${bin}" test args > "expected/$${bin}.stdout" 2> "expected/$${bin}.stderr"; done
-
-run: $(BINS)
-	for bin in $(BINS); do echo "# $${bin} #"; "./$${bin}" test args; done
+	for bin in $(BINS); \
+	do \
+		echo "# $${bin} #"; \
+		"./$${bin}" test args > "expected/$${bin}.stdout" 2> "expected/$${bin}.stderr"; \
+	done
 
-test: $(BINS)
-	for bin in $(BINS); do echo "# $${bin} #"; "./$${bin}" test args; done
+verify: $(BINS)
+	rm -rf gen
+	mkdir -p gen
+	for bin in $(BINS); \
+	do \
+		echo "# $${bin} #"; \
+		"./$${bin}" test args > "gen/$${bin}.stdout" 2> "gen/$${bin}.stderr"; \
+		diff -u "gen/$${bin}.stdout" "expected/$${bin}.stdout"; \
+		diff -u "gen/$${bin}.stderr" "expected/$${bin}.stderr"; \
+	done
 
 GCCHEAD=\
 	-nostdinc \