[+] Added process test

[*] Update Aurora
This commit is contained in:
Reece Wilson 2022-02-21 12:32:48 +00:00
parent 6b0e11741c
commit 0b8362a90d
2 changed files with 48 additions and 1 deletions

@ -1 +1 @@
Subproject commit c6d649e3de9cd1cdc3fc39a2713a0e1cc572e5e1
Subproject commit 9e26996463b70f00bcdfa7e8439a8012c237683c

View File

@ -0,0 +1,47 @@
/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Main.cpp
Date: 2022-2-18
Author: Reece
***/
#include <AuroraRuntime.hpp>
#include <gtest/gtest.h>
TEST(Process, RunSystem)
{
auto proc = "^/HelloSystem"
#if defined(AURORA_PLATFORM_WIN32)
".exe"
#endif
;
AuProcesses::StartupParmaters params;
params.type = AuProcesses::ESpawnType::eSpawnChildProcessWorker;
params.process = proc;
params.fwdOut = true;
params.fwdIn = true;
params.noShowConsole = true;
auto process = AuProcesses::SpawnUnique(params);
ASSERT_TRUE(static_cast<bool>(process));
ASSERT_TRUE(process->Start());
AuByteBuffer stdoutPipe(4096 * 16);
AuUInt written {};
while (process->Read(AuProcesses::EStandardHandle::eStdOut, AuMemoryViewStreamWrite {stdoutPipe.begin(), stdoutPipe.end(), written}, false))
{
AuLogDbg("STDOUT {}", AuString(stdoutPipe.begin(), stdoutPipe.begin() + written));
}
process->AsWaitable()->Lock();
AuLogDbg("Exit Code: 0x{:x}", process->GetExitCode());
}
void RunTests()
{
Aurora::RuntimeStartInfo info;
info.console.fio.enableLogging = false;
info.console.forceToolKitWindow = false;
Aurora::RuntimeStart(info);
}