diff --git a/Aurora/Runtime b/Aurora/Runtime index 7864966..191f5df 160000 --- a/Aurora/Runtime +++ b/Aurora/Runtime @@ -1 +1 @@ -Subproject commit 786496647819719a93030e235b6a8535a74b0a64 +Subproject commit 191f5df2a13e959e67114de9e8f97cf2f1d7d6ff diff --git a/Tests/Common/entrypoint.cpp b/Tests/Common/entrypoint.cpp index c2d559a..92709ac 100644 --- a/Tests/Common/entrypoint.cpp +++ b/Tests/Common/entrypoint.cpp @@ -12,6 +12,7 @@ #include "gtest/gtest.h" #include "test.hpp" +#include "unit.hpp" #include "console.hpp" using namespace Aurora::UnitTesting; @@ -23,7 +24,10 @@ int main(int argsc, const char ** argsv) Aurora::UnitTesting::Console::Init(); RunTests(); ::testing::InitGoogleTest(&argsc, (char **)argsv); - RUN_ALL_TESTS(); + if (::testing::UnitTest::GetInstance()->total_test_count()) + { + UnitAssert(RUN_ALL_TESTS() == 0, "gtest failed"); + } if (Aurora::RuntimeHasStarted()) { Aurora::RuntimeShutdown(); diff --git a/Tests/Private/.keepme b/Tests/Private/.keepme new file mode 100644 index 0000000..e69de29 diff --git a/Tests/Public/3. Hello Command Line/Main.cpp b/Tests/Public/3. Hello Command Line/Main.cpp new file mode 100644 index 0000000..8bbedbe --- /dev/null +++ b/Tests/Public/3. Hello Command Line/Main.cpp @@ -0,0 +1,42 @@ +/*** + Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. + + File: Main.cpp + Date: 2022-2-18 + Author: Reece +***/ +#include + +static void PrintAll() +{ + const auto &flags = AuCmdLine::GetFlags(); + AuLogInfo("Flags: {}", flags.size()); + for (const auto &flag : flags) + { + AuLogInfo(" {}", flag); + } + + const auto &values = AuCmdLine::GetValues(); + AuLogInfo("Values: {}", values.size()); + for (const auto &key : values) + { + AuLogInfo(" {}={}", key, AuCmdLine::GetValue(key, "error")); + } +} + +void RunTests() +{ + Aurora::RuntimeStartInfo info; + info.console.fio.enableLogging = false; + info.console.forceToolKitWindow = false; + Aurora::RuntimeStart(info); + + PrintAll(); + + // Different command line interfaces will parse execv or generate the process command line string differently + // For instance, the flag 'hello world' looks like this across different platforms + // + // Powershell: & '.\3. Hello Command Line.Stage.Win32.x86_64.exe' Hello` World + // CMD : "3. Hello Command Line.Stage.Win32.x86_64.exe" "Hello World" + // Linux : ./3.\ Hello\ Command\ Line.Stage.Linux.x86_64 Hello\ World +} \ No newline at end of file