3 include $(patsubst %,$(SRCDIR)/%/Make.tests,$(TEST_SUBDIRS))
5 PROGS = $(foreach subdir,$(TEST_SUBDIRS),$($(subdir)_PROGS))
6 TESTS = $(foreach subdir,$(TEST_SUBDIRS),$($(subdir)_TESTS))
8 include ../../Makefile.userprog
10 PINTOSFLAGS += -v $(foreach file,$(PUTFILES),-p $(file) -a $(notdir $(file)))
12 PINTOS = pintos $(PINTOSOPTS) $(PINTOSFLAGS) -- $(KERNELFLAGS)
14 OUTPUTS = $(addsuffix .output,$(TESTS))
15 ERRORS = $(addsuffix .errors,$(TESTS))
16 RESULTS = $(addsuffix .result,$(TESTS))
19 rm -f $(OUTPUTS) $(ERRORS) $(RESULTS)
21 grade:: ../rubric.txt results
23 for d in $(TESTS); do \
24 if echo PASS | cmp -s $$d.result -; then \
28 $(SRCDIR)/tests/make-grade $< $$pass
33 echo "Test summary:"; \
34 for d in $(TESTS); do \
35 if echo PASS | cmp -s $$d.result -; then \
43 if [ $$f = 0 ]; then \
44 echo "All $$n tests passed."; \
46 echo "$$f of $$n tests failed."; \
53 $(foreach prog,$(PROGS),$(eval $(prog).output: $(prog)))
54 $(foreach test,$(TESTS),$(eval $(test).output: $($(test)_PUTFILES)))
55 tests/%.output: RUNCMD = $(if $($*_ARGS),run '$(*F) $($*_ARGS)',run $(*F))
56 tests/%.output: RUNREDIR = 2>$*.errors $(if $(VERBOSE),|tee,>) $*.output
57 tests/%.output: RUNTEST = $(PINTOS) $(RUNCMD) $(RUNREDIR)
61 %.result: %.ck %.output
62 perl -I$(SRCDIR) $< $* $@