소스 검색

Add verification makefile rule

Jeremy Soller 7 년 전
부모
커밋
54655a4e3b
2개의 변경된 파일24개의 추가작업 그리고 6개의 파일을 삭제
  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 \