From e0a1899b0f9aa693023a81add2667a1da8bdcf3d Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 25 Nov 2024 13:15:02 +0100 Subject: [PATCH] makes run scripts --- CodexUnitTestCrusher/Program.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/CodexUnitTestCrusher/Program.cs b/CodexUnitTestCrusher/Program.cs index fbd71e2..b632cac 100644 --- a/CodexUnitTestCrusher/Program.cs +++ b/CodexUnitTestCrusher/Program.cs @@ -17,6 +17,7 @@ "vendor" ]; + private readonly List scriptPaths = new List(); private readonly string Include = "import std/random"; private readonly string SleepLine = "await sleepAsync(rand(10))"; private readonly int NumCompiles = 10; @@ -38,6 +39,25 @@ public void Run() { TraverseFolder(Root); + CreateRunScripts(); + } + + private void CreateRunScripts() + { + var lineLines = new List>(); + lineLines.Add(new List()); + lineLines.Add(new List()); + lineLines.Add(new List()); + + var i = 0; + foreach (var script in scriptPaths) + { + lineLines[i].Add($"sh \"{script}\""); + i = (i + 1) % lineLines.Count; + } + File.WriteAllLines(@"C:\Projects\nim-codex\runall1.sh", lineLines[0]); + File.WriteAllLines(@"C:\Projects\nim-codex\runall2.sh", lineLines[1]); + File.WriteAllLines(@"C:\Projects\nim-codex\runall3.sh", lineLines[2]); } private void TraverseFolder(string root) @@ -83,7 +103,9 @@ }).ToArray(); - File.WriteAllLines(Path.Combine(path, scriptFile), lines); + var fullPath = Path.Combine(path, scriptFile); + File.WriteAllLines(fullPath, lines); + scriptPaths.Add(fullPath); } private void AddRandomSleepsToNimFile(string file)