diff options
| author | Morten Sørvig <morten.sorvig@qt.io> | 2022-08-15 10:07:37 +0200 |
|---|---|---|
| committer | Morten Sørvig <morten.sorvig@qt.io> | 2022-08-17 04:52:46 +0200 |
| commit | ad0cb1f32ddfbdf7dbfee1ca92c0f1d9137c1a91 (patch) | |
| tree | 0c7f0f5576bb32da7cfee56473bf207f3d627fa0 /tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.js | |
| parent | 83cf2985e941ee9ca6f0ef076ca4f5770cfb1f2c (diff) | |
wasm: add "skip" support to qtwasmtestlib
We're not looking to skip faulty tests, but there are cases
where we would like to indicate that a test function exists
but can't run because some precondition is not met.
Pick-to: 6.4
Change-Id: Ifaaafcfa7a55beaaf56d8b25fabbe3dc2566350f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Diffstat (limited to 'tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.js')
| -rw-r--r-- | tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.js b/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.js index 96ff3d81a70..c9a393098de 100644 --- a/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.js +++ b/tests/manual/wasm/qtwasmtestlib/qtwasmtestlib.js @@ -156,8 +156,18 @@ function testFunctionStarted(name) { } function testFunctionCompleted(status) { - const color = status.startsWith("PASS") ? "green" : status.startsWith("FAIL") ? "red" : "black"; - let line = `<span style='color: ${color};'>${status}</text><br>`; + + const color = (status) => { + if (status.startsWith("PASS")) + return "green"; + if (status.startsWith("FAIL")) + return "red"; + if (status.startsWith("SKIP")) + return "tan"; + return "black"; + }; + + const line = `<span style='color: ${color(status)};'>${status}</text><br>`; g_htmlLogElement.innerHTML += line; } |
