-TESTS = threads p1 userprog p2 vm p3 filesys p4
+TESTS = examples threads p1 userprog p2 vm p3 filesys p4
PATH := $(shell pwd)/../src/utils:$(PATH)
endef
define run-tests
-cd $@/src/$(PROJECT) && $(MAKE) check PINTOSOPTS=$(PINTOSOPTS)
+cd $@/src/$(PROJECT) && time $(MAKE) check
endef
define grade-tests
cd $@/src/$(PROJECT) && $(MAKE)
endef
+define test-clean
+cd $@/src/$(PROJECT)/build && $(MAKE) clean
+cd $@/src/$(PROJECT)/build && set `find -type f` > /dev/null && test $$# = 1
+endef
+
define clean
rm -rf $@
endef
$(mk-sandbox)
$(compile)
$(run-tests) TESTS=tests/threads/alarm-single
+ $(test-clean)
$(clean)
userprog vm filesys::
+ $(mk-sandbox)
+ $(compile)
+ $(test-clean)
+ $(clean)
+examples::
$(mk-sandbox)
$(compile)
$(clean)
# Tests for the reference solutions.
-p2 p3 p4: PINTOSOPTS = --qemu
p1 p2 p3 p4::
$(mk-sandbox)
$(apply-patch)
$(run-tests)
$(grade-tests)
+ $(test-clean)
$(clean)