test.run

From RPTools Wiki
Revision as of 11:25, 31 May 2024 by Bubblobill (talk | contribs) (Initial entry created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Languages:  English


test.run() Function

 Note: This function can only be used in a Trusted Macro

Runs all test: prefixed macros on selected test: tokens. If no tokens selected, runs all test: macros on all test: tokens on the current map. Displays and stores results.

Usage

test.run()

Example

[r: test.run()]

Results of tests are stored on a token property with the name of the test macro as a json object.

[r: getProperty("test: myUDFs")]
output: {"status":"failure","messages":[" Failed, expected 1 got 0"]}

Function changes macro button colour to indicate success or failure.

Success and Failure coloured macros

See Also

Languages:  English