Skip to content

Commit

Permalink
Refactored make check
Browse files Browse the repository at this point in the history
  • Loading branch information
terminationshock committed Feb 15, 2023
1 parent 72c66dc commit 7827150
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ a.out
bf
*.x
*.s
OUT.*
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ 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))

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 $<
Expand Down

0 comments on commit 7827150

Please sign in to comment.