Skip to content

Commit

Permalink
Add a dry run to tests to not skew times by assembly loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ZehMatt committed Oct 23, 2021
1 parent 0db97e9 commit 7702e13
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Dotx64DbgManagedTests/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,24 @@ private static void LogException(TestingState state, Exception ex)
}
}

private static void DryRunTest(TestingState state, object instance, TestGroup group, TestEntry test)
{
try
{
test.Function.Invoke(instance, Array.Empty<object>());
}
catch (Exception ex)
{
}
}

private static bool RunTest(TestingState state, object instance, TestGroup group, TestEntry test)
{
bool passed = true;

// Do not account for assembly loading, make a quiet run first.
DryRunTest(state, instance, group, test);

var sw = new Stopwatch();
state.Ran++;

Expand Down

0 comments on commit 7702e13

Please sign in to comment.