From 66e99d349b31f5cd30b868d80ebdab6ba749fd96 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Sun, 24 Jan 2021 22:29:36 +0100 Subject: tests: enable wpt for url (#9046) --- docs/contributing/building_from_source.md | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'docs/contributing') diff --git a/docs/contributing/building_from_source.md b/docs/contributing/building_from_source.md index 227b42418..7801d1b15 100644 --- a/docs/contributing/building_from_source.md +++ b/docs/contributing/building_from_source.md @@ -109,3 +109,38 @@ cargo clean && cargo build -vv # Run: ./target/debug/deno run cli/tests/002_hello.ts ``` + +### Testing + +> :warning: **IMPORTANT**: Our test suite relies on certain entries to be +> configured in your /etc/hosts file. If these entries are not present in your +> /etc/hosts file, the `web_platform_tests` test **will** fail. To configure +> these entries, run the following command: + +> ```shell +> # macOS / Linux +> cd test_utils/wpt/ +> ./wpt make-hosts-file | sudo tee -a /etc/hosts +> ``` + +> ```powershell +> # Windows (use powershell!) +> cd test_utils/wpt/ +> python wpt make-hosts-file | Out-File $env:SystemRoot\System32\drivers\etc\hosts -Encoding ascii -Append +> ``` + +> If you use WSL, be aware that WSL may attempt to override /etc/hosts each time +> it is launched, which would then require you to re-run hosts this setup. This +> behavior +> [can be configured](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#network). + +```shell +# Run the full test suite: +cargo test + +# Run a specific test: +cargo test web_platform_tests + +# Run a specific test, and don't swallow test output: +cargo test web_platform_tests -- --nocapture +``` -- cgit v1.2.3