summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Doroshenko (Xrayez) <xrayez@gmail.com>2020-08-08 21:53:51 +0300
committerAndrii Doroshenko (Xrayez) <xrayez@gmail.com>2020-08-08 21:54:23 +0300
commit6a495f4d042000bb2583ab5d16b0354248833c6e (patch)
treea63a95e92dc49c6b8bc4f9339d5423dd91e29eaf
parent69c81309cc786cc5702fb8d558636fb31f207971 (diff)
Properly detect `--test` command-line argument
Do not prematurely parse anything which beings with `--test` to run doctest. This allows other commands to be run, such as `--test-gdscript` or other custom arguments.
-rw-r--r--main/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 5f791159f9..c5500a1f66 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -372,7 +372,7 @@ void Main::print_help(const char *p_binary) {
int Main::test_entrypoint(int argc, char *argv[], bool &tests_need_run) {
#ifdef TESTS_ENABLED
for (int x = 0; x < argc; x++) {
- if (strncmp(argv[x], "--test", 6) == 0) {
+ if ((strncmp(argv[x], "--test", 6) == 0) && (strlen(argv[x]) == 6)) {
tests_need_run = true;
OS::get_singleton()->initialize();
StringName::setup();