From 7827150493981f2ade419b7ecaa83e736ce533c1 Mon Sep 17 00:00:00 2001 From: Tobias Melson Date: Wed, 15 Feb 2023 12:27:16 +0100 Subject: [PATCH] Refactored make check --- .gitignore | 1 + Makefile | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6b417f9..06ec209 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ a.out bf *.x *.s +OUT.* diff --git a/Makefile b/Makefile index 5ea7c41..cd92654 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ clean: rm -f a.out rm -f *.x rm -f *.s + rm -f OUT.* TEST_FILES=hello_world add rot13 pi TESTS=$(patsubst %, test/%, $(TEST_FILES)) @@ -19,10 +20,12 @@ TESTS=$(patsubst %, test/%, $(TEST_FILES)) check: $(EXE) $(TESTS) test/%: test/%.0.x test/%.1.x - test ! -f $@.in || diff -q $@.out <(./$< < $@.in) - test -f $@.in || diff -q $@.out <(./$<) - test ! -f $@.in || diff -q $@.out <(./$(word 2,$^) < $@.in) - test -f $@.in || diff -q $@.out <(./$(word 2,$^)) + test ! -f $@.in || ./$< < $@.in > OUT.0 + test -f $@.in || ./$< > OUT.0 + diff -q $@.out OUT.0 + test ! -f $@.in || ./$(word 2,$^) < $@.in > OUT.1 + test -f $@.in || ./$(word 2,$^) > OUT.1 + diff -q $@.out OUT.1 test/%.0.x: test/%.bf ./$(EXE) -o $@ -O0 $<