Skip to content
Snippets Groups Projects
Commit 501ecabf authored by gback's avatar gback
Browse files

fix make -j

This patch avoids the wrong applications of rules when running
make -j grade.  Previously, this resulted in redundant failing
runs that took time and left files such as .error and .output
around.
parent 52c83b51
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ PROGS = $(foreach subdir,$(TEST_SUBDIRS),$($(subdir)_PROGS))
TESTS = $(foreach subdir,$(TEST_SUBDIRS),$($(subdir)_TESTS))
EXTRA_GRADES = $(foreach subdir,$(TEST_SUBDIRS),$($(subdir)_EXTRA_GRADES))
OUTPUTS = $(addsuffix .output,$(TESTS) $(EXTRA_GRADES))
OUTPUTS = $(addsuffix .output,$(TESTS))
ERRORS = $(addsuffix .errors,$(TESTS) $(EXTRA_GRADES))
RESULTS = $(addsuffix .result,$(TESTS) $(EXTRA_GRADES))
......@@ -47,7 +47,8 @@ outputs:: $(OUTPUTS)
$(foreach prog,$(PROGS),$(eval $(prog).output: $(prog)))
$(foreach test,$(TESTS),$(eval $(test).output: $($(test)_PUTFILES)))
$(foreach test,$(TESTS),$(eval $(test).output: TEST = $(test)))
$(foreach test,$(TESTS),$(eval $(test).output: TEST := $(test)))
$(foreach test,$(TESTS),$(eval $(test).output: TEST_BASENAME := $(notdir $(test))))
# Prevent an environment variable VERBOSE from surprising us.
VERBOSE =
......@@ -67,11 +68,14 @@ TESTCMD += $(KERNELFLAGS)
ifeq ($(filter userprog, $(KERNEL_SUBDIRS)), userprog)
TESTCMD += -f
endif
TESTCMD += $(if $($(TEST)_ARGS),run '$(*F) $($(TEST)_ARGS)',run $(*F))
TESTCMD += $(if $($(TEST)_ARGS),run '$(TEST_BASENAME) $($(TEST)_ARGS)',run $(TEST_BASENAME))
TESTCMD += < /dev/null
TESTCMD += 2> $(TEST).errors $(if $(VERBOSE),|tee,>) $(TEST).output
%.output: kernel.bin loader.bin
$(TESTCMD)
@# do not apply this rule to the persistence tests
@if [[ ! "$@" =~ .*persistence.* ]]; then\
$(TESTCMD);\
fi
%.result: %.ck %.output
perl -I$(SRCDIR) $< $* $@
......@@ -45,7 +45,10 @@ GETCMD += run 'tar fs.tar /'
GETCMD += < /dev/null
GETCMD += 2> $(TEST)-persistence.errors $(if $(VERBOSE),|tee,>) $(TEST)-persistence.output
tests/filesys/extended/%.output: kernel.bin
EXTENDED_OUTPUTS = $(addsuffix .output, $(addprefix tests/filesys/extended/,$(raw_tests)))
# a custom rule for the extended tests that also test persistence
$(EXTENDED_OUTPUTS): kernel.bin loader.bin
$(eval TMPDSK := tmp-$(subst /,-,$(subst .output,,$@)).dsk)
rm -f $(TMPDSK)
pintos-mkdisk $(TMPDSK) --filesys-size=2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment