GutHookScript

Inherits: RefCounted

This script is the base for custom scripts to be used in pre and post run hooks.

Description

GUT Wiki: https://gut.readthedocs.io

Creating a hook script requires that you:

  • Inherit GutHookScript

  • Implement a run() method

  • Configure the path in GUT (gutconfig and/or editor) as the approparite hook (pre or post).

See Hooks

Properties

Variant

JunitXmlExport

load(...)

Variant

gut

null

Methods

Variant

abort()

Variant

get_exit_code()

Variant

register_inner_classes(script: Script)

Variant

run()

Variant

set_exit_code(code: int)

Variant

should_abort()


Property Descriptions

Variant JunitXmlExport = load(...) 🔗

Class responsible for generating xml. You could use this to generate XML yourself instead of using the built in GUT xml generation options. See addons/gut/junit_xml_export.gd


Variant gut = null 🔗

This is the instance of GutMain that is running the tests. You can get information about the run from this object. This is set by GUT when the script is instantiated.


Method Descriptions

Variant run() 🔗

Virtual method that will be called by GUT after instantiating this script. This is where you put all of your logic.


Variant register_inner_classes(script: Script) 🔗

Register inner classes from one or more scripts for doubling. Only worth calling from pre-run hook, not post-run.


Variant set_exit_code(code: int) 🔗

Set the exit code when running from the command line. If not set then the default exit code will be returned (0 when no tests fail, 1 when any tests fail).


Variant get_exit_code() 🔗

Returns the exit code set with set_exit_code


Variant abort() 🔗

Usable by pre-run script to cause the run to end AFTER the run() method finishes. GUT will quit and post-run script will not be ran.


Variant should_abort() 🔗

Returns if abort was called.