Skip to content

Commit

Permalink
Update the "Running the tests manually" section of the README for tes…
Browse files Browse the repository at this point in the history
…ts/wpt.

The previous instructions did not work because of how
resources/testharnessreport.js is actually a template. Update the instructions
to provide instructions for replacing that file.
  • Loading branch information
jyc committed Aug 1, 2017
1 parent 3be1be0 commit 1267811
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions tests/wpt/README.md
Expand Up @@ -64,9 +64,12 @@ environment.
Running the tests manually
--------------------------

(See also [the relevant section of the upstream README][upstream-running].)

It can be useful to run a test without the interference of the test runner, for
example when using a debugger such as `gdb`. In that case, start the server by
first adding the following to the system's hosts file:
example when using a debugger such as `gdb`.

To do this, first add the following to the system's hosts file:

127.0.0.1 www.web-platform.test
127.0.0.1 www1.web-platform.test
Expand All @@ -75,9 +78,35 @@ first adding the following to the system's hosts file:
127.0.0.1 xn--n8j6ds53lwwkrqhv28a.web-platform.test
127.0.0.1 xn--lve-6lad.web-platform.test

and then running `python serve` from `tests/wpt/web-platform-tests`.
Then, navigate to `tests/wpt/web-platform-tests`. Next, create a directory,
e.g. `local-resources/`, to contain a local copy of the
`resources/testharnessreport.js` file. The version in the repository is
actually a Python format string that has substitution done on it by
`harness/wptrunner/environment.py` to configure test output. Then, place a
modified copy of the `testharnessreport.js` file in that directory, removing
the format string variable:

mkdir local-resources
cp resources/testharnessreport.js local-resources/
$EDITOR local-resources/testharnessreport.js
# Replace `output:%(output)d` with `output:1` or `output:0`.

Now create a configuration file at `config.json` for the web-platform-tests
server (configuration options you don't specify will be loaded from the
defaults at `config.default.json`) with the following contents:

{"aliases": [
{"url-path": "/resources/testharnessreport.js",
"local-dir": "local-resources"
}
]
}

Finally, you can run `python serve` from `tests/wpt/web-platform-tests`.
Then navigate Servo to `http://web-platform.test:8000/path/to/test`.

[upstream-running]: https://github.com/w3c/web-platform-tests#running-the-tests

Running the tests in Firefox
----------------------------

Expand Down

0 comments on commit 1267811

Please sign in to comment.