File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 2
2
# License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
4
5
+ @tool # To ensure that itest is not run from the editor; see below.
6
+
5
7
extends Node
6
8
class_name GDScriptTestRunner
7
9
8
10
func _ready ():
11
+ # Check that tests are invoked from the command line. Loading the editor may break some parts (e.g. generated test code).
12
+ # Both checks are needed (it's possible to invoke `godot -e --headless`).
13
+ if Engine .is_editor_hint () || DisplayServer .get_name () != 'headless' :
14
+ push_error ("Integration tests must be run in headless mode (without editor)." )
15
+ get_tree ().quit (2 )
16
+ return
17
+
9
18
# Ensure physics is initialized, for tests that require it.
10
19
await get_tree ().physics_frame
11
20
You can’t perform that action at this time.
0 commit comments