instead of just doing so in tests/Makefile.
Update documentation to match.
@file{filesys/Make.vars} to enable VM functionality. You can receive up
to 5% extra credit if you do enable VM.
-The tests for project 4 will run much faster if
-you use the qemu emulator, e.g.@: via @code{make check
-PINTOSOPTS='--qemu'}.
-
@menu
* Project 4 Background::
* Project 4 Requirements::
program twice and have it do exactly the same thing. On second and
later runs, you can make new observations without having to discard or
verify your old observations. This property is called
-``reproducibility.'' The simulator we use by default, Bochs, can be set
-up for
+``reproducibility.'' One of the simulators that Pintos supports, Bochs,
+can be set up for
reproducibility, and that's the way that @command{pintos} invokes it
by default.
of the test results.
For project 1, the tests will probably run faster in Bochs. For the
-rest of the projects, they will probably run faster in qemu.
+rest of the projects, they will run much faster in qemu.
+@command{make check} will select the faster simulator by default, but
+you can override its choice by specifying @option{SIMULATOR=--bochs} or
+@option{SIMULATOR=--qemu} on the @command{make} command line.
You can also run individual tests one at a time. A given test @var{t}
writes its output to @file{@var{t}.output}, then a script scores the
specifying @option{VERBOSE=1} on the @command{make} command line, as in
@code{make check VERBOSE=1}. You can also provide arbitrary options to the
@command{pintos} run by the tests with @option{PINTOSOPTS='@dots{}'},
-e.g.@: @code{make check PINTOSOPTS='--qemu'} to run the tests under
-qemu.
+e.g.@: @code{make check PINTOSOPTS='-j 1'} to select a jitter value of 1
+(@pxref{Debugging Versus Testing}).
All of the tests and related files are in @file{pintos/src/tests}.
Before we test your submission, we will replace the contents of that
projects 3 and 4, but it is not strictly required.
You might find it useful to go back and reread how to run the tests
-(@pxref{Testing}). In particular, the tests for project 2 (and later
-projects) will run much faster if you use the qemu emulator, e.g.@:
-via @code{make check PINTOSOPTS='--qemu'}.
+(@pxref{Testing}).
@menu
* Project 2 Background::
You will continue to handle Pintos disks and file systems the same way
you did in the previous assignment (@pxref{Using the File System}).
-The tests for project 3 (and later projects) will run much faster if
-you use the qemu emulator, e.g.@: via @code{make check
-PINTOSOPTS='--qemu'}.
-
@menu
* Project 3 Background::
* Project 3 Suggested Order of Implementation::
KERNEL_SUBDIRS = threads devices lib lib/kernel userprog filesys
TEST_SUBDIRS = tests/userprog tests/filesys/base tests/filesys/extended
GRADING_FILE = $(SRCDIR)/tests/filesys/Grading.no-vm
+SIMULATOR = --qemu
# Uncomment the lines below to enable VM.
#os.dsk: DEFINES += -DVM
$(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))
KERNEL_SUBDIRS = threads devices lib lib/kernel $(TEST_SUBDIRS)
TEST_SUBDIRS = tests/threads
GRADING_FILE = $(SRCDIR)/tests/threads/Grading
+SIMULATOR = --bochs
KERNEL_SUBDIRS = threads devices lib lib/kernel userprog filesys
TEST_SUBDIRS = tests/userprog tests/userprog/no-vm tests/filesys/base
GRADING_FILE = $(SRCDIR)/tests/userprog/Grading
+SIMULATOR = --qemu
# Command-line options.
our ($start_time) = time ();
-our ($sim) = $ENV{PINTOSSIM}; # Simulator: bochs, qemu, or gsx.
+our ($sim); # Simulator: bochs, qemu, or gsx.
our ($debug) = "none"; # Debugger: none, monitor, or gdb.
our ($mem) = 4; # Physical RAM in MB.
our ($serial_out) = 1; # Send output to serial port?
--swap-disk=FILE|SIZE Set swap disk file (default: swap.dsk)
Other options:
-h, --help Display this help message.
-Environment variables:
- PINTOSSIM Select default simulator.
EOF
exit $exitcode;
}
KERNEL_SUBDIRS = threads devices lib lib/kernel userprog filesys vm
TEST_SUBDIRS = tests/userprog tests/vm tests/filesys/base
GRADING_FILE = $(SRCDIR)/tests/vm/Grading
+SIMULATOR = --qemu
endef
define run-tests
-cd $@/src/$(PROJECT) && $(MAKE) check PINTOSOPTS=$(PINTOSOPTS)
+cd $@/src/$(PROJECT) && $(MAKE) check
endef
define grade-tests
$(clean)
# Tests for the reference solutions.
-p2 p3 p4: PINTOSOPTS = --qemu
p1 p2 p3 p4::
$(mk-sandbox)
$(apply-patch)