From 29cdab217f0c5dce854aac451d9b9eab16a3f463 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 22 Oct 2015 09:52:34 -0400 Subject: [PATCH] Add documentation for writing new tests. --- tests/wpt/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/wpt/README.md b/tests/wpt/README.md index 05c746c4e0a..63cba55a452 100644 --- a/tests/wpt/README.md +++ b/tests/wpt/README.md @@ -96,6 +96,26 @@ log is saved, run from the root directory: For CSSWG tests a similar prcedure works, with `./mach test-css` and `./mach update-css`. +Writing new tests +================= + +The simplest way to create a new test is to use the following command: + + ./mach create-wpt tests/wpt/path/to/new/test.html --no-run + +This will create test.html in the appropriate directory using the WPT +template for JavaScript tests. To create a new reference test instead, +use the following: + + ./mach create-wpt --reftest tests/wpt/path/to/new/reftest.html --no-run --reference tests/wpt/path/to/reference.html + +`reference.html` will be created if it doesn't not exist, and `reftest.html` +will be created using the WPT reftest template. These new tests can then +be run in the following manner like any other WPT test: + + ./mach test-wpt tests/wpt/path/to/new/test.html + ./mach test-wpt tests/wpt/path/to/new/reftest.html + Editing tests =============