From ba4fd61c0737f1b005e71147c05a6c66f6695582 Mon Sep 17 00:00:00 2001 From: Reece Date: Mon, 6 Jun 2022 17:36:02 +0100 Subject: [PATCH] [*] Linux no go. Interim NT update. --- Aurora/Interfaces | 2 +- Aurora/ROXTL | 2 +- Aurora/Runtime | 2 +- Build_Scripts | 2 +- Tests/Public/22. Hello Console/Main.cpp | 38 +++++----- Tests/Public/23. Hello Shell Console/Main.cpp | 74 +++++++++++++++++++ Tests/Public/6. Hello Compression/Main.cpp | 33 ++------- Vendor/nlohmannjson | 2 +- Win_x86_x64_Lite.bat | 2 + 9 files changed, 106 insertions(+), 51 deletions(-) create mode 100644 Tests/Public/23. Hello Shell Console/Main.cpp create mode 100644 Win_x86_x64_Lite.bat diff --git a/Aurora/Interfaces b/Aurora/Interfaces index f6025d0..8712c9a 160000 --- a/Aurora/Interfaces +++ b/Aurora/Interfaces @@ -1 +1 @@ -Subproject commit f6025d08cdc85911579c401cb85d49621609546e +Subproject commit 8712c9a621bce3930245b42a6bf678cb4e9bd3e7 diff --git a/Aurora/ROXTL b/Aurora/ROXTL index ea33682..4fb09a6 160000 --- a/Aurora/ROXTL +++ b/Aurora/ROXTL @@ -1 +1 @@ -Subproject commit ea336826dd53c72c8caf075d0412546ac363d0e1 +Subproject commit 4fb09a68e921f3cf3ecd759787ff4fdc69964cec diff --git a/Aurora/Runtime b/Aurora/Runtime index 23e922a..97938fc 160000 --- a/Aurora/Runtime +++ b/Aurora/Runtime @@ -1 +1 @@ -Subproject commit 23e922a39679482d3f17fedf7ea393b7f595b723 +Subproject commit 97938fcaeb4f0e1d1f29bff9699c51e7d9091acb diff --git a/Build_Scripts b/Build_Scripts index a4e296c..d551cda 160000 --- a/Build_Scripts +++ b/Build_Scripts @@ -1 +1 @@ -Subproject commit a4e296c86744973cf5212e094d8e7d8b88195f00 +Subproject commit d551cda998c04c72a0d63bc585c0ad6cac633507 diff --git a/Tests/Public/22. Hello Console/Main.cpp b/Tests/Public/22. Hello Console/Main.cpp index 05f934d..2c21268 100644 --- a/Tests/Public/22. Hello Console/Main.cpp +++ b/Tests/Public/22. Hello Console/Main.cpp @@ -8,26 +8,28 @@ #include #include +using namespace AuConsole::ConsoleTTY; + static void PrintDebug() { - AuConsole::TTYFill(' ', AuConsole::EAnsiColor::eBoldMagenta, AuConsole::EAnsiColor::eBoldMagenta); - AuConsole::TTYWrite("Hello Red and Green\n", AuConsole::EAnsiColor::eRed, AuConsole::EAnsiColor::eBlue); - AuConsole::TTYWrite("To blank\n"); - AuConsole::TTYMoveY(1); - AuConsole::TTYClearLine(AuConsole::EAnsiColor::eBoldMagenta); - AuConsole::TTYWrite("Overwritten\n"); - AuConsole::TTYWrite("Hello Red and Green", AuConsole::EAnsiColor::eRed, AuConsole::EAnsiColor::eBoldGreen); - AuConsole::TTYWrite("Hello Bold Red and Green\n", AuConsole::EAnsiColor::eBoldRed, AuConsole::EAnsiColor::eBoldGreen); - AuConsole::TTYWrite("Hello Green and Green\n", AuConsole::EAnsiColor::eGreen, AuConsole::EAnsiColor::eBoldGreen); - AuConsole::TTYWrite("Hello Bold Green and Blue\n", AuConsole::EAnsiColor::eBoldGreen, AuConsole::EAnsiColor::eBlue); - AuConsole::TTYWrite("Hello Yellow and Green\n", AuConsole::EAnsiColor::eYellow, AuConsole::EAnsiColor::eBoldGreen); - AuConsole::TTYWrite("Hello Bold Yellow and Green\n", AuConsole::EAnsiColor::eBoldYellow, AuConsole::EAnsiColor::eBoldGreen); - AuConsole::TTYWrite("Hello Blue and Green\n", AuConsole::EAnsiColor::eBlue, AuConsole::EAnsiColor::eBoldGreen); - AuConsole::TTYWrite("Hello Bold Blue and Green\n", AuConsole::EAnsiColor::eBoldBlue, AuConsole::EAnsiColor::eBoldGreen); - AuConsole::TTYWrite("Hello Magenta and Green\n", AuConsole::EAnsiColor::eMagenta, AuConsole::EAnsiColor::eBoldGreen); - AuConsole::TTYWrite("Hello Bold Magenta and Green\n", AuConsole::EAnsiColor::eBoldMagenta, AuConsole::EAnsiColor::eBoldGreen); - AuConsole::TTYWrite("Hello Cyan and Green\n", AuConsole::EAnsiColor::eCyan, AuConsole::EAnsiColor::eBoldGreen); - AuConsole::TTYWrite("Hello Bold Cyan and Green\n", AuConsole::EAnsiColor::eBoldCyan, AuConsole::EAnsiColor::eBoldGreen); + TTYFill(' ', AuConsole::EAnsiColor::eBoldMagenta, AuConsole::EAnsiColor::eBoldMagenta); + TTYWrite("Hello Red and Green\n", AuConsole::EAnsiColor::eRed, AuConsole::EAnsiColor::eBlue); + TTYWrite("To blank\n"); + TTYMoveY(1); + TTYClearLine(AuConsole::EAnsiColor::eBoldMagenta); + TTYWrite("Overwritten\n"); + TTYWrite("Hello Red and Green", AuConsole::EAnsiColor::eRed, AuConsole::EAnsiColor::eBoldGreen); + TTYWrite("Hello Bold Red and Green\n", AuConsole::EAnsiColor::eBoldRed, AuConsole::EAnsiColor::eBoldGreen); + TTYWrite("Hello Green and Green\n", AuConsole::EAnsiColor::eGreen, AuConsole::EAnsiColor::eBoldGreen); + TTYWrite("Hello Bold Green and Blue\n", AuConsole::EAnsiColor::eBoldGreen, AuConsole::EAnsiColor::eBlue); + TTYWrite("Hello Yellow and Green\n", AuConsole::EAnsiColor::eYellow, AuConsole::EAnsiColor::eBoldGreen); + TTYWrite("Hello Bold Yellow and Green\n", AuConsole::EAnsiColor::eBoldYellow, AuConsole::EAnsiColor::eBoldGreen); + TTYWrite("Hello Blue and Green\n", AuConsole::EAnsiColor::eBlue, AuConsole::EAnsiColor::eBoldGreen); + TTYWrite("Hello Bold Blue and Green\n", AuConsole::EAnsiColor::eBoldBlue, AuConsole::EAnsiColor::eBoldGreen); + TTYWrite("Hello Magenta and Green\n", AuConsole::EAnsiColor::eMagenta, AuConsole::EAnsiColor::eBoldGreen); + TTYWrite("Hello Bold Magenta and Green\n", AuConsole::EAnsiColor::eBoldMagenta, AuConsole::EAnsiColor::eBoldGreen); + TTYWrite("Hello Cyan and Green\n", AuConsole::EAnsiColor::eCyan, AuConsole::EAnsiColor::eBoldGreen); + TTYWrite("Hello Bold Cyan and Green\n", AuConsole::EAnsiColor::eBoldCyan, AuConsole::EAnsiColor::eBoldGreen); } static void ReadStdInNonBlocking() diff --git a/Tests/Public/23. Hello Shell Console/Main.cpp b/Tests/Public/23. Hello Shell Console/Main.cpp new file mode 100644 index 0000000..c962a36 --- /dev/null +++ b/Tests/Public/23. Hello Shell Console/Main.cpp @@ -0,0 +1,74 @@ +/*** + Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. + + File: Main.cpp + Date: 2022-2-18 + Author: Reece +***/ +#include +#include + +using namespace AuConsole::ConsoleTTY; + +#define ASYNC + +void RunTests() +{ + Aurora::RuntimeStartInfo info; +#if defined(ASYNC) + info.async.enableSchedularThread = true; + info.async.schedularFrequency = 2;// 1000; + info.async.enableSysPumpFreqnecy = true; +#else + info.async.enableSchedularThread = false; +#endif + info.console.fio.enableLogging = false; + + Aurora::RuntimeStart(info); + + GetTTYConsole()->Start(); + GetTTYConsole()->SetHeaderBorderTitle("Hello"); + GetTTYConsole()->SetHeaderAlignment(ETTYAlign::eCenter); + + GetTTYConsole()->SetHeader(fmt::format("Aurora Shell: {}", __DATE__)); + + GetTTYConsole()->SetSubHeader("https://reece.sx"); + GetTTYConsole()->SetSubheaderAlignment(ETTYAlign::eRight); + + +#if !defined(ASYNC) + + while (true) + { + AuThreading::Sleep(10); + Aurora::RuntimeSysPump(); + } + +#else + + auto app = AuAsync::GetAsyncApp(); + + struct LineWriter : AuAsync::IWorkItemHandler + { + int ticks = 0; + + void DispatchFrame(ProcessInfo &info) override + { + + info = AuAsync::ETickType::eSchedule; + info.reschedMs = 20 + AuMin((this->ticks++) * 50, 1'000); + + AuLogInfo("Hello {}", ticks); + } + + }; + + app->Start(); + + app->NewWorkItem({}, AuMakeShared())->Dispatch(); + + app->Run(); + +#endif + +} \ No newline at end of file diff --git a/Tests/Public/6. Hello Compression/Main.cpp b/Tests/Public/6. Hello Compression/Main.cpp index 15b548f..c0798c8 100644 --- a/Tests/Public/6. Hello Compression/Main.cpp +++ b/Tests/Public/6. Hello Compression/Main.cpp @@ -101,20 +101,9 @@ static void TestBasicCompression(AuCompression::ECompressionType type) AuCompression::CompressionInfo info; info.type = type; - pipe.inPipe = [&](void *buf, AuUInt len) -> AuUInt - { - AuUInt len2 = len; - if (reader.Read(AuMemory::MemoryViewStreamWrite(buf, len2)) != AuIO::EStreamError::eErrorNone) - { - return {}; - } - return len2; - }; - - pipe.writePipe = [&](const void *buf, AuUInt len) - { - compressed.Write(AuMemory::MemoryViewStreamRead(buf, len)); - }; + pipe.inPipe = AuUnsafeRaiiToShared(&reader); + pipe.writePipe = AuUnsafeRaiiToShared(&compressed); + info.compressionLevel = 4; ASSERT_TRUE(AuCompression::Compress(pipe, info)); } @@ -125,20 +114,8 @@ static void TestBasicCompression(AuCompression::ECompressionType type) AuIO::Buffered::BlobReader reader(compressed.GetBuffer()); AuCompression::CompressionPipe pipe; - pipe.inPipe = [&](void *buf, AuUInt len) -> AuUInt - { - AuUInt len2 = len; - if (reader.Read(AuMemory::MemoryViewStreamWrite(buf, len2)) != AuIO::EStreamError::eErrorNone) - { - return {}; - } - return len2; - }; - - pipe.writePipe = [&](const void *buf, AuUInt len) - { - decompressed.Write(AuMemory::MemoryViewStreamRead(buf, len)); - }; + pipe.inPipe = AuUnsafeRaiiToShared(&reader); + pipe.writePipe = AuUnsafeRaiiToShared(&decompressed); ASSERT_TRUE(AuCompression::Decompress(pipe, {type, 1024 * 64 * 2})); } diff --git a/Vendor/nlohmannjson b/Vendor/nlohmannjson index a944306..3b16057 160000 --- a/Vendor/nlohmannjson +++ b/Vendor/nlohmannjson @@ -1 +1 @@ -Subproject commit a94430615d8360272151f602b8c9eeb58509ecde +Subproject commit 3b16057ffaaed250cf207233f9238392ea0245ee diff --git a/Win_x86_x64_Lite.bat b/Win_x86_x64_Lite.bat new file mode 100644 index 0000000..80fdca6 --- /dev/null +++ b/Win_x86_x64_Lite.bat @@ -0,0 +1,2 @@ +cd .\Build_Scripts +win_x86.bat --lite %* --target-x86_64 \ No newline at end of file