Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
arakis committed Nov 2, 2019
1 parent 5e26f1a commit c9dbd69
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Abanu.Tools.Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,30 @@ private static CommandResult RunQemu(CommandArgs args)
case "direct":
if (args.ContainsFlag("test"))
{
var success = false;

Exec(
"${qemu} -kernel ${ABANU_OSDIR}/Abanu.OS.Image.${ABANU_ARCH}.bin -serial stdio -m 256 -display none",
(line, proc) =>
{
if (line.Contains(KConfig.SelfTestPassedMarker))
{
success = true;
proc.Kill();
Console.WriteLine("TEST PASSED");
Environment.Exit(0);
}
}, TimeSpan.FromSeconds(60));

Console.WriteLine("Test FAILED");
Environment.Exit(1);
if (success)
{
Environment.Exit(0);
}
else
{
Console.WriteLine("Test FAILED");
Environment.Exit(1);
}
}
else
{
Expand Down

0 comments on commit c9dbd69

Please sign in to comment.