fixed backtrace to work with -O (now conforms to
[pintos-anon] / tests / Makefile
index 5d53e286b71c3e49a657e19350003631d8dfba8f..c2f8b018d3ebec2830bc09b9281f542db64dd7e8 100644 (file)
@@ -1,4 +1,4 @@
-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)
 
@@ -19,7 +19,7 @@ cd $@/src && $(MAKE) -s clean
 endef
 
 define run-tests
-cd $@/src/$(PROJECT) && $(MAKE) check PINTOSOPTS=$(PINTOSOPTS)
+cd $@/src/$(PROJECT) && time $(MAKE) check
 endef
 
 define grade-tests
@@ -32,6 +32,11 @@ define compile
 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
@@ -51,17 +56,23 @@ threads::
        $(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)