From 57e8798ce554f77f5419366e7d88af8e71c59103 Mon Sep 17 00:00:00 2001 From: Remzi Arpaci-Dusseau Date: Fri, 29 Mar 2019 07:04:10 -0500 Subject: [PATCH 1/4] Quick update to add details on xv6 tests --- initial-xv6/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/initial-xv6/README.md b/initial-xv6/README.md index 205cb27..a3c3e81 100644 --- a/initial-xv6/README.md +++ b/initial-xv6/README.md @@ -59,6 +59,31 @@ Using gdb (the debugger) may be helpful in understanding code, doing code traces, and is helpful for later projects too. Get familiar with this fine tool! +# Running Tests + +Running tests for your system call is easy. Just do the following from +inside the `initial-xv6` directory: + +```sh +prompt> ./test-getreadcounts.sh +``` + +If you implemented things correctly, you should get some notification +that the tests passed. If not ... + +The tests assume that xv6 source code is found in the `src/` subdirectory. +If it's not there, the script will complain. + +The test script does a one-time clean build of your xv6 source code +using a newly generated makefile called `Makefile.test`. You can use +this when debugging (assuming you ever make mistakes, that is), e.g.: + +```sh +prompt> make -f Makefile.test qemu-nox +``` + + + From 2413f5b43143ff95b4a1c36e2ae46360d3a3239a Mon Sep 17 00:00:00 2001 From: Remzi Arpaci-Dusseau Date: Fri, 29 Mar 2019 07:06:13 -0500 Subject: [PATCH 2/4] add clarification on how to stop rebuilding --- initial-xv6/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/initial-xv6/README.md b/initial-xv6/README.md index a3c3e81..510585f 100644 --- a/initial-xv6/README.md +++ b/initial-xv6/README.md @@ -82,8 +82,9 @@ this when debugging (assuming you ever make mistakes, that is), e.g.: prompt> make -f Makefile.test qemu-nox ``` +You can suppress the repeated building of xv6 in the tests with the +`-s` flag. This should make repeated testing faster: - - - - +```sh +prompt> ./test-getreadcounts.sh -s +``` From df119b65f4eace0f350d6836d5216d49ce432831 Mon Sep 17 00:00:00 2001 From: Remzi Arpaci-Dusseau Date: Sun, 31 Mar 2019 08:47:31 -0500 Subject: [PATCH 3/4] add detail on run-xv6-command --- tester/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tester/README.md b/tester/README.md index 71f29a2..ae5ffd7 100644 --- a/tester/README.md +++ b/tester/README.md @@ -20,6 +20,11 @@ The files needed to describe a test number `n` are: - `n.pre` (optional): Code to run before the test, to set something up - `n.post` (optional): Code to run after the test, to clean something up +There is also a single file called `pre` which gets run once at the +beginning of testing; this is often used to do a more complex build +of a code base, for example. To prevent repeated time-wasting pre-test +activity, suppress this with the `-s` flag (as described below). + In most cases, a wrapper script is used to call `run-tests.sh` to do the necessary work. @@ -29,4 +34,13 @@ The options for `run-tests.sh` include: * `-t n` (run only test `n`) * `-c` (continue even after a test fails) * `-d` (run tests not from `tests/` directory but from this directory instead) +* `-s` (suppress running the one-time set of commands in `pre` file) + +There is also another script used in testing of `xv6' projects, called +`run-xv6-command`. This is an `expect` script which launches the qemu +emulator and runs the relevant testing command in the xv6 environment +before automatically terminating the test. It is used by the `run-tests.sh` +script as described above and thus not generally called by users directly. + + From 04bb0b81fce39d864acaff84a0ccc7bae5c79a24 Mon Sep 17 00:00:00 2001 From: Remzi Arpaci-Dusseau Date: Sun, 31 Mar 2019 08:47:54 -0500 Subject: [PATCH 4/4] nit --- tester/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tester/README.md b/tester/README.md index ae5ffd7..069bced 100644 --- a/tester/README.md +++ b/tester/README.md @@ -36,7 +36,7 @@ The options for `run-tests.sh` include: * `-d` (run tests not from `tests/` directory but from this directory instead) * `-s` (suppress running the one-time set of commands in `pre` file) -There is also another script used in testing of `xv6' projects, called +There is also another script used in testing of `xv6` projects, called `run-xv6-command`. This is an `expect` script which launches the qemu emulator and runs the relevant testing command in the xv6 environment before automatically terminating the test. It is used by the `run-tests.sh`