Skip to content

Commit 926caeb

Browse files
committed
Added support for VERBOSE output from UnitTesting
1 parent 59623e8 commit 926caeb

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

S8UnitTest.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public int RunUnitTest(S8Dissasembler s8d,string unitTestFile)
2121
int lineCounter = 0;
2222
int errCnt = 0;
2323
int currentaddress = 0;
24+
bool verbose = false;
2425

2526
if (s8d is null) return 0;
2627

@@ -54,11 +55,24 @@ public int RunUnitTest(S8Dissasembler s8d,string unitTestFile)
5455
var cmds = actualLine.Split(" ");
5556
if (cmds.Length < 2)
5657
continue;
58+
string param = string.Empty;
5759

5860
var command = cmds[1].ToUpper().Trim();
59-
var param = cmds[2].ToUpper().Trim();
61+
if (cmds.Length > 2)
62+
{
63+
param = cmds[2].ToUpper().Trim();
64+
}
65+
6066
switch (command)
6167
{
68+
case "VERBOSE":
69+
verbose = true;
70+
if (param.Contains("FALSE"))
71+
{
72+
verbose = false;
73+
}
74+
75+
break;
6276
case "TICKS":
6377
case "MAXTICKS":
6478
int newTicks = 0;
@@ -111,7 +125,7 @@ public int RunUnitTest(S8Dissasembler s8d,string unitTestFile)
111125

112126
s8d.SetInput(bInput);
113127

114-
currentaddress = s8d.Run(false);
128+
currentaddress = s8d.Run(false, verbose);
115129
string stdout = s8d.GetOutput();
116130

117131
if (input[1].Equals(stdout))

0 commit comments

Comments
 (0)