Add more tests.
[pintos-anon] / grading / userprog / Makefile
index 25ba85759b7e0bbfab6354f8f4eb72adbd67950b..c1e5f24a9d8e2884b7815d9c98c54190ce88f638 100644 (file)
@@ -1,27 +1,40 @@
 SRCDIR = ../../src
 
-SINGLETONS = \
+# Main test programs.
+TESTS = \
+       $(addprefix args-, argc argv0 argvn single multiple dbl-space) \
+       $(addprefix sc-, bad-sp bad-arg boundary) \
+       halt exit \
        $(addprefix create-, normal empty null bad-ptr long exists bound) \
-       $(addprefix args-, argc argv0 argvn single multiple dbl-space)
-
-define SINGLETON_PROG
+       $(addprefix open-, normal missing boundary empty null bad-ptr twice) \
+       $(addprefix close-, normal twice stdin stdout bad-fd) \
+       $(addprefix read-, normal bad-ptr boundary zero stdout bad-fd) \
+       $(addprefix write-, normal bad-ptr boundary zero stdin bad-fd) \
+       $(addprefix exec-, once arg multiple missing bad-ptr) \
+       $(addprefix join-, simple twice killed bad-pid) \
+       $(addprefix multi-, recurse oom)
+
+define TEST_PROG
 PROGS += $(1)
-$(1)_SRC = $(1).c
+$(subst -,_,$(1))_SRC = $(1).c
 endef
 
-$(foreach prog,$(SINGLETONS),$(eval $(call SINGLETON_PROG,$(prog))))
+$(foreach prog,$(TESTS),$(eval $(call TEST_PROG,$(prog))))
 DISKS = $(patsubst %,%.dsk,$(PROGS))
 
 disks: $(DISKS)
 
-PINTOS = ../../src/utils/pintos
-OS_DISK = ../../src/userprog/build/os.dsk
+# Other programs needed by some of the main test programs. 
+PROGS += child-simple child-arg child-bad
+child_simple_SRC = child-simple.c
+child_arg_SRC = child-arg.c
+child_bad_SRC = child-bad.c
+exec-once.dsk exec-multiple.dsk join-simple.dsk join-twice.dsk: child-simple
+exec-arg.dsk: child-arg
+join-killed.dsk: child-bad
+
 %.dsk: %
-       rm -f $@.tmp
-       $(PINTOS) make-disk $@.tmp 2
-       $(PINTOS) -v --os-disk=$(OS_DISK) --fs-disk=$@.tmp run -f -q
-       $(PINTOS) -v --os-disk=$(OS_DISK) --fs-disk=$@.tmp put $<
-       mv $@.tmp $@
+       ./prep-disk $<
 
 clean::
        rm -f $(DISKS)