From 70b1794129b0d6e8b41bb5a9c1487a64354ba0a7 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Thu, 28 Mar 2024 18:10:08 +0100 Subject: [PATCH] Add status codes --- README.md | 2 ++ addons/besseretests/src/runtimescene.gd | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8939dd0..c2711e1 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ Use this command to test your project in the command line: # └─────────────────────────────────── Tells Godot to not display a window. Omit if you strictly need a window. ``` +The process will exit with code `0` on success (all tests except skipped onces passing), `1` with warnings (all tests either passing or throwing warnings except skipped ones) and `2` on failure (some tests failing). + ## File structure Here's a file structure for this project: ```plain diff --git a/addons/besseretests/src/runtimescene.gd b/addons/besseretests/src/runtimescene.gd index 0e456ce..506cac7 100644 --- a/addons/besseretests/src/runtimescene.gd +++ b/addons/besseretests/src/runtimescene.gd @@ -89,7 +89,9 @@ func _ready() -> void: lresu("") # Shutdown - terminate() + if stats_all == stats_ok: terminate(0) + elif stats_all == stats_ok + stats_warn: terminate(1) + else: terminate(2) # Runs a test suite func run_suite(suite: String) -> void: