From b0620ae57bccb033d0ecc6c7ab00246011b04fa1 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sun, 28 Jan 2024 07:26:46 +0100 Subject: [PATCH] Fix github workflow running out of memory --- tests/test_filesystem.c | 6 ------ tests/test_lexer.cpp | 6 ++++-- tests/test_main.cpp | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/test_filesystem.c b/tests/test_filesystem.c index eb6a313..ae5884d 100644 --- a/tests/test_filesystem.c +++ b/tests/test_filesystem.c @@ -55,13 +55,7 @@ int main() { S8_String dir_path = OS_GetExeDir(&arena); S8_String work_path = OS_GetWorkingDir(&arena); S8_String abs_path = OS_GetAbsolutePath(&arena, read_file_path); - /* - @todo: MAC - I have no idea what is happening on mac with this - dir_path = /Users/runner/work/first/first/build/test_filesystem_debug_clang_mac_os/test_filesystem.exe - exe_path = /Users/runner/work/first/first/build/test_filesystem_debug_clang_mac_os/test_filesystem.exe - */ IO_Assert(OS_IsDir(dir_path)); IO_Assert(!OS_IsFile(dir_path)); diff --git a/tests/test_lexer.cpp b/tests/test_lexer.cpp index 26ce275..a8ed955 100644 --- a/tests/test_lexer.cpp +++ b/tests/test_lexer.cpp @@ -7,10 +7,12 @@ #include "../standalone_libraries/clexer.c" void TestLexDir(S8_String dir) { - MA_Scratch scratch; + MA_Scratch scratch_filenames; char buff[1024]; char msg_buff[1024]; - for (OS_FileIter iter = OS_IterateFiles(scratch, dir); OS_IsValid(iter); OS_Advance(&iter)) { + for (OS_FileIter iter = OS_IterateFiles(scratch_filenames, dir); OS_IsValid(iter); OS_Advance(&iter)) { + MA_Scratch scratch(scratch_filenames.checkpoint); + S8_String file = OS_ReadFile(scratch, iter.absolute_path); if (!file.str) continue; CL_Lexer lexer = CL_Begin(scratch, file.str, iter.absolute_path.str); diff --git a/tests/test_main.cpp b/tests/test_main.cpp index ad16fc2..37368e9 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -20,8 +20,7 @@ int main() { TestBootstrapExclusive(); TestBootstrapArenaClear(); - // TestClexer(); - // IO_Printf("TestClexer() - DONE\n"); + TestClexer(); // Unicode iteration over codepoints using For {