mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
Documentation: Explain how to import tests using the WPT.sh script
This commit is contained in:
parent
6d9dab5a29
commit
21b705ee32
Notes:
github-actions[bot]
2024-11-05 09:39:54 +00:00
Author: https://github.com/sideshowbarker Commit: https://github.com/LadybirdBrowser/ladybird/commit/21b705ee327 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2115 Reviewed-by: https://github.com/tcl3
3 changed files with 14 additions and 0 deletions
|
@ -58,6 +58,8 @@ Note that this also applies to debug logging and other internal strings, as they
|
|||
|
||||
When possible, please include tests when fixing bugs or adding new features.
|
||||
|
||||
If changes you’re making have relevant [Web Platform Tests (WPT)](https://wpt.fyi/) tests — especially if the changes cause Ladybird to pass any WPT tests it hadn’t yet been passing — you should consider [importing those tests into your Ladybird clone](https://github.com/LadybirdBrowser/ladybird/blob/master/Documentation/Testing.md#importing-web-platform-tests), and then commit the imported tests along with your code changes.
|
||||
|
||||
## Code submission policy
|
||||
|
||||
Nobody is perfect, and sometimes we mess things up. That said, here are some good do's & don'ts to try and stick to:
|
||||
|
|
|
@ -89,3 +89,4 @@ Make sure your code meets the requirements in the [full contribution guidelines]
|
|||
* Make correctly formatted, atomic commits (building the project at every commit should succeed).
|
||||
* Discuss and resolve any reviews you receive.
|
||||
* Fix CI failures by editing your commits.
|
||||
* Include tests ([use `Meta/import-wpt-test.py` to import WPT tests](Testing.md#importing-web-platform-tests))
|
||||
|
|
|
@ -110,6 +110,17 @@ git checkout my-css-change
|
|||
./Meta/WPT.sh run --log results.log
|
||||
```
|
||||
|
||||
### Importing Web Platform Tests
|
||||
|
||||
You can import certain Web Platform Tests (WPT) tests into your Ladybird clone (if they’re tests of type that can be imported — and especially if any code changes you’re making cause Ladybird to pass any WPT tests it hasn’t yet been passing). Here’s how:
|
||||
|
||||
```sh
|
||||
./Meta/WPT.sh import html/dom/aria-attribute-reflection.html
|
||||
```
|
||||
|
||||
That is, you give `./Meta/WPT.sh import` the path part of any `http://wpt.live/` URL for a WPT test you want to import. It will then download both that test and any of its JavaScript scripts, copy those to the `Tests/LibWeb/Text/input/wpt-import` directory, run the test, and then in the `Tests/LibWeb/Text/expected/wpt-import` directory, it will create a file with the expected results from the test.
|
||||
|
||||
|
||||
## Writing tests
|
||||
|
||||
Running `Tests/LibWeb/add_libweb_test.py your-new-test-name` will create a new test HTML file in
|
||||
|
|
Loading…
Reference in a new issue