From b0ee910326120ba3da0519ca573b6e18e11a0877 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Thu, 28 Mar 2024 17:38:57 +0100 Subject: [PATCH] Add command line script --- README.md | 12 ++++++++++++ addons/besseretests/scenesrc/runtimescene.tscn | 2 +- addons/besseretests/src/cmd.gd | 5 +++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 addons/besseretests/src/cmd.gd diff --git a/README.md b/README.md index e65a6b7..d636871 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,18 @@ var test_directory: String = "res://tests" This is the default configuration. If you want to keep a config key to it's default simply comment it out. +## Command line +Use this command to test your project in the command line: +```bash +/bin/to/godot.binary --headless -d -v -s --path "." addons/besseretests/src/cmd.gd +# │ │ │ │ │ │ └───────── Path to Bessere Tests' command line script +# │ │ │ │ └──────┴──────────── Tells Godot where your project is located +# │ │ │ └───────────────────── Tells Godot to operate in script mode +# │ │ └─────────────────────── Makes the output verbose, omit if it prints too much irrelevant output +# │ └───────────────────────── Starts the engine in debug mode, helps debugging issues in your tests +# └─────────────────────────────────── Tells Godot to not display a window. Omit if you strictly need a window. +``` + ## File structure Here's a file structure for this project: ```plain diff --git a/addons/besseretests/scenesrc/runtimescene.tscn b/addons/besseretests/scenesrc/runtimescene.tscn index 7af9f0f..69d701f 100644 --- a/addons/besseretests/scenesrc/runtimescene.tscn +++ b/addons/besseretests/scenesrc/runtimescene.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://addons/besseretests/src/runtimescene.gd" id="1_icwe0"] -[node name="TestingScene" type="Control"] +[node name="RuntimeScene" type="Control"] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 diff --git a/addons/besseretests/src/cmd.gd b/addons/besseretests/src/cmd.gd new file mode 100644 index 0000000..f786c1a --- /dev/null +++ b/addons/besseretests/src/cmd.gd @@ -0,0 +1,5 @@ +extends SceneTree + +var scene: Node = load("res://addons/besseretests/scenesrc/runtimescene.tscn").instantiate() + +func _initialize() -> void: root.add_child(scene)