Make the default simulator qemu for project 2...4,
[pintos-anon] / src / tests / Make.tests
index b60243f5c6bc7640fd2bc32bfa03c1833cbdaa7b..9cb992bda4b48b8b288f7d877e4142d0ea536336 100644 (file)
@@ -7,9 +7,12 @@ TESTS = $(foreach subdir,$(TEST_SUBDIRS),$($(subdir)_TESTS))
 
 include ../../Makefile.userprog
 
-PINTOSFLAGS += -v $(foreach file,$(PUTFILES),-p $(file) -a $(notdir $(file)))
+TIMEOUT = 60
+PINTOSFLAGS += -v -T $(TIMEOUT)                                                \
+       $(foreach file,$(PUTFILES),-p $(file) -a $(notdir $(file)))
 KERNELFLAGS += -q
-PINTOS = pintos $(PINTOSOPTS) $(PINTOSFLAGS) -- $(KERNELFLAGS)
+
+PINTOS = pintos $(SIMULATOR) $(PINTOSOPTS) $(PINTOSFLAGS) -- $(KERNELFLAGS)
 
 OUTPUTS = $(addsuffix .output,$(TESTS))
 ERRORS = $(addsuffix .errors,$(TESTS))
@@ -23,13 +26,13 @@ grade:: results
 
 check:: results
        @cat $<
-       @COUNT="`egrep '^(pass|FAIL) ' $< | wc -l`";            \
-       FAILURES="`egrep '^FAIL ' $< | wc -l`";                 \
-       if [ "$$FAILURES" = 0 ]; then                           \
-               echo "All $$COUNT tests passed.";               \
-       else                                                    \
-               echo "$$FAILURES of $$COUNT tests failed.";     \
-               exit 1;                                         \
+       @COUNT="`egrep '^(pass|FAIL) ' $< | wc -l | sed 's/[    ]//g;'`"; \
+       FAILURES="`egrep '^FAIL ' $< | wc -l | sed 's/[         ]//g;'`"; \
+       if [ $$FAILURES = 0 ]; then                                       \
+               echo "All $$COUNT tests passed.";                         \
+       else                                                              \
+               echo "$$FAILURES of $$COUNT tests failed.";               \
+               exit 1;                                                   \
        fi
 
 results: $(RESULTS)