Add more tests.
[pintos-anon] / grading / userprog / Makefile
index 85ee607f51184d7938a681052e8f7aff7212de00..6ce6cba81cabf34d8d17aa4081f135cdd2ee46d2 100644 (file)
@@ -1,6 +1,7 @@
 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 \
@@ -8,18 +9,29 @@ SINGLETONS = \
        $(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 write-, normal bad-ptr boundary zero stdin bad-fd) \
+       $(addprefix exec-, once arg multiple missing bad-ptr) \
+       $(addprefix join-, simple twice killed bad-pid)
 
-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 $<