Skip to content

Commit eda107c

Browse files
author
KJDS Srinivasa Rao
committed
Updated output directory path
1 parent 0ac9d98 commit eda107c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CodeExecutor.ConsoleTest/Program.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static void Main(string[] args)
2727
var cSharpcodeExecutor = new CSharpCodeExecutor("", "", false);
2828
var jsCodeExecutor = new JavaScriptCodeExecutor();
2929
var testOutput = new StringBuilder();
30+
var testOutputDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Outputs");
3031
foreach (var test in tests)
3132
{
3233
Console.WriteLine($"Executing test : {test.FileName} , code type : {test.CodeType}");
@@ -54,8 +55,11 @@ static void Main(string[] args)
5455
testOutput.AppendLine();
5556
Console.WriteLine();
5657
}
57-
58-
var filePath = Path.Combine(Directory.GetCurrentDirectory(), DateTime.UtcNow.ToString("yyyyMMddHHmmssffff") + ".txt");
58+
if(!Directory.Exists(testOutputDirectory))
59+
{
60+
Directory.CreateDirectory(testOutputDirectory);
61+
}
62+
var filePath = Path.Combine(testOutputDirectory, DateTime.UtcNow.ToString("yyyyMMddHHmmssffff") + ".txt");
5963
File.WriteAllText(filePath, testOutput.ToString());
6064
Console.WriteLine($"Test output is generated at {filePath}");
6165
}

0 commit comments

Comments
 (0)