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)