Skip to content

Commit d848fbd

Browse files
committed
tests: update README with new commands and some formatting improvements
1 parent 6eb1b68 commit d848fbd

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

test/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
`svg` includes unit tests. These tests render SVGs at different sizes, and compare those images against known, "good" versions. If the images are similar enough, the test passes; otherwise, they fail.
44

5-
To run the tests, run `haxe test.hxml`. This generates an `svg-tests.html` file in the repository root, which shows a row per image. For each row, it displays:
5+
To run the tests, run of the following commands.
6+
7+
- Windows: `openfl test windows`
8+
- macOS: `openfl test windows`
9+
- Linux: `openfl test linux`
10+
- Neko: `openfl test neko`
11+
- HashLink: `openfl test hl`
12+
13+
On Haxe `sys` targets, this generates an `svg-tests.html` file in the repository root, which shows a row per image. For each row, it displays:
14+
615
- The SVG
716
- The actual (expected) PNG rendering
817
- The rendered PNG version
@@ -17,9 +26,8 @@ To add a new test, you need to:
1726
- Open the SVG in GIMP, and render it to PNG at whatever size you want to render the SVG to. Save it with the filename `<pngname>-<width>x<height>.png` (eg. `apple-64x64.png`).
1827
- Open up `test/SvgGeneration.hx` and add a new test. Something like this:
1928

20-
```
21-
@Test
22-
public function appleScalesUpCorrectly()
29+
```haxe
30+
public function testAppleScalesUpCorrectly()
2331
{
2432
generateAndCompare("apple.svg"); // 56x56 (SVG size)
2533
generateAndCompare("apple.svg", 256, 256);
@@ -28,6 +36,7 @@ public function appleScalesUpCorrectly()
2836
```
2937

3038
This sample test renders `apple.svg` three times: at its original size (56x56), at 256x256, and 137x137. You need to add three new files to the `test/images` directory:
39+
3140
- `apple-56x56.png`
3241
- `apple-137x137.png`
3342
- `apple-256x256.png`

0 commit comments

Comments
 (0)