You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/README.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,16 @@
2
2
3
3
`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.
4
4
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
+
6
15
- The SVG
7
16
- The actual (expected) PNG rendering
8
17
- The rendered PNG version
@@ -17,9 +26,8 @@ To add a new test, you need to:
17
26
- 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`).
18
27
- Open up `test/SvgGeneration.hx` and add a new test. Something like this:
@@ -28,6 +36,7 @@ public function appleScalesUpCorrectly()
28
36
```
29
37
30
38
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:
0 commit comments