Skip to content

Commit

Permalink
feat: Add ability to use instrument lib with test runners.
Browse files Browse the repository at this point in the history
  • Loading branch information
vantreeseba committed Jan 24, 2025
1 parent 4f058ec commit 7839351
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .vim/coc-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"haxe.hxml": "build.hxml"
}
4 changes: 4 additions & 0 deletions src/dropecho/testing/BuddyIncludeMacros.hx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class BuddyIncludeMacros {
var suites = $a{suites};
var runner = new buddy.SuitesRunner(suites, null);
runner.run().then(_ -> {
#if instrument
instrument.coverage.Coverage.endCoverage();
#end

Sys.exit(runner.statusCode());
});
},
Expand Down
10 changes: 9 additions & 1 deletion src/dropecho/testing/UTestIncludeMacros.hx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ class UTestIncludeMacros {
runner.addCase(s);
}

utest.ui.Report.create(runner);
#if instrument
runner.onComplete.add(_ -> {
instrument.coverage.Coverage.endCoverage();
});
#end

utest.ui.Report.create(runner, utest.ui.common.HeaderDisplayMode.SuccessResultsDisplayMode.NeverShowSuccessResults,
utest.ui.common.HeaderDisplayMode.NeverShowHeader);

runner.run();
}
}),
Expand Down

0 comments on commit 7839351

Please sign in to comment.