Add more tests.
[pintos-anon] / grading / userprog / Makefile
index e95e13fdaf032568be18041a61059077f0ed6d03..c1e5f24a9d8e2884b7815d9c98c54190ce88f638 100644 (file)
@@ -1,24 +1,38 @@
 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 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 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 SINGLETON_PROG
+define TEST_PROG
 PROGS += $(1)
 $(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)
 
+# 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: %
        ./prep-disk $<