Skip to content

Commit

Permalink
"big" test: test the program output
Browse files Browse the repository at this point in the history
as opposed to the "small" doctests which test individual functions.
  • Loading branch information
gelisam committed Jun 19, 2013
1 parent 769296b commit b0b17de
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
24 changes: 21 additions & 3 deletions Makefile
@@ -1,6 +1,6 @@
NAME="$(shell basename `pwd`)"

.PHONY: all config build doc demo clean clobber
.PHONY: all config build doc test small-tests big-tests demo clean clobber

all: build doc test

Expand All @@ -15,14 +15,32 @@ build: config
doc:
find src demo -name '*.hs' | xargs haddock --no-warnings --odir=doc --html

test: build

test: small-tests big-tests

small-tests: build
find src demo -name '*.hs' | xargs doctest
@echo


big-tests: $(patsubst tests/%.expected,proofs/%.proof,$(shell find tests -name '*.expected'))
-@echo '*** ALL TESTS OK ***'

proofs/%.proof: proofs/%.out tests/%.expected
diff $^
touch $@

proofs/%.out: tests/%.in build
mkdir -p $(dir $@)
./dist/build/$(NAME)-demo/$(NAME)-demo < $< > $@


demo: build
./dist/build/$(NAME)-demo/$(NAME)-demo
./dist/build/$(NAME)-demo/$(NAME)-demo < tests/hello.in


clean:
rm -rf proofs

clobber: clean
rm -rf dist
1 change: 1 addition & 0 deletions tests/hello.expected
@@ -0,0 +1 @@
typechecks.
Empty file added tests/hello.in
Empty file.

0 comments on commit b0b17de

Please sign in to comment.