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
This patch adds `TestSkipIf` and `TestSkipIfNot` commands to
simplify the handling of particular features that are unupported
in a given environment. This allows us to change the condition
for skip centrally. For example, should Emscripten start supporting
wait we could turn all those tests on with a one line change.
Copy file name to clipboardExpand all lines: docs/development/testing.md
+26-2Lines changed: 26 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,22 @@ Before running each test command, the test framework inserts a test library stac
60
60
*`TestDiagnostic pMessage`: Write *pMessage* to the test log as a message.
61
61
*`TestAssert pDescription, pExpectTrue`: Make a test assertion. The test is recorded as a failure if *pExpectTrue* is false. *pDescription* should be a short string that describes the test (e.g. "clipboard is clear").
62
62
*`TestSkip pDescription, pReasonSkipped`: Record a test as having been skipped. *pReasonSkipped* should be a short explanation of why the test was skipped (e.g. "not supported on Windows").
63
+
*`TestSkipIf pRequirement, pOptions`: Skip a test if the requirements
64
+
are met. `pOptions` varies depending on the `pRequirement` enum. The
65
+
following requirements are implemented:
66
+
-`ide` - the IDE repo is available. No options.
67
+
-`lcb` - LCB compilation supported
68
+
-`docs` - the docs are available. No options.
69
+
-`securityPermissions` - Option `set` to skip if a test should not
70
+
set the `securityPermissions`
71
+
-`platform` - options are comma delimited platform strings
72
+
-`processor` - options are comma delimited processor strings
73
+
-`stack` - options are comma delimited stack names to test if they
74
+
are available
75
+
-`environment` - options are comma delimited environment strings
76
+
*`TestSkipIfNot pRequirement, pOptions`: Skip a test if the
77
+
requirements are not met. Requirements and options are the same as for
78
+
`TestSkipIf`.
63
79
*`TestAssertBroken pDescription, pExpectTrue, pReasonBroken`: The same as `TestAssert`, but marking the test as "expected to fail". *pReasonBroken* should be a short explanation of why the test is currently expected to fail; it should almost always be a reference to a bug report, e.g. "bug 54321".
64
80
*`TestAssertThrow pDescription, pHandlerName, pTarget, pExpectedError, pParam`: Assert that a given handler triggers the expected error message. *pHandlerName* is the name of the handler containing the script expected to cause an error; it is dispatched to *pTarget* with *pParam* as a parameter within a try/catch structure. *pExpectedError* is the expected script execution error name in the enumeration in engine/src/executionerrors.h - e.g. `"EE_PROPERTY_CANTSET"`.
65
81
*`TestAssertDoesNotThrow pDescription, pHandlerName, pTarget, pParam`: Assert that a given handler does not trigger any exceptions. *pHandlerName* is the name of the handler containing the script expected to cause an error; it is dispatched to *pTarget* with *pParam* as a parameter within a try/catch structure.
@@ -73,19 +89,27 @@ Before running each test command, the test framework inserts a test library stac
73
89
- `pTimeOut` is the amount of milliseconds to continue testing the result of the handler.
74
90
- `pParamsArray` is an array of parameters, keyed by the 1-based index of the required parameter to be passed to the handler.
75
91
*`TestAssertErrorDialog pDescription, pErrorCode`: Assert that this test triggers an errorDialog message with the given error.
92
+
*`TestIsInStandalone()`: Checks if the test is being run by the
93
+
standalone test runner.
94
+
76
95
Tests can have additional setup requirements before running, for example loading custom libraries. If the script test contains a handler called `TestSetup`, this will be run prior to running each test command. For example:
77
96
````
78
97
on TestSetup
98
+
TestSkipIfNot "docs"
79
99
-- All the tests in this script require access to the docs parser
0 commit comments