Skip to content

Commit

Permalink
added -D disable-attributable-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Jan 22, 2025
1 parent e6e480c commit 3b209ba
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/HaxeTestController.hx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ class HaxeTestController {
var haxeExecutable = vshaxe.haxeExecutable.configuration;

testCommand = testCommand.map(arg -> if (arg == "${haxe}") haxeExecutable.executable else arg);
if (!isAttributableCoverageEnabled()) {
testCommand.push("-D");
testCommand.push("disable-attributable-coverage");
}

var task = new Task({type: "haxe-test-explorer-run"}, workspaceFolder, "Running Haxe Tests with Coverage", "haxe",
new ProcessExecution(testCommand.shift(), testCommand, {env: haxeExecutable.env}), cast vshaxe.problemMatchers);
Expand Down
4 changes: 3 additions & 1 deletion test-adapter/_testadapter/buddy/Injector.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class Injector {
public static function buildRunner():Array<Field> {
var coverageEnabled:Null<String> = Context.definedValue("instrument-coverage");
var baseFolder = haxe.io.Path.join([_testadapter.data.Data.FOLDER]);

#if disable_attributable_coverage
coverageEnabled = null;
#end
var fields = Context.getBuildFields();
for (field in fields) {
switch (field.name) {
Expand Down
3 changes: 3 additions & 0 deletions test-adapter/_testadapter/munit/Injector.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class Injector {
var fields = Context.getBuildFields();
var coverageEnabled:Null<String> = Context.definedValue("instrument-coverage");
var baseFolder = haxe.io.Path.join([_testadapter.data.Data.FOLDER]);
#if disable_attributable_coverage
coverageEnabled = null;
#end
for (field in fields) {
switch (field.name) {
case "new":
Expand Down
3 changes: 3 additions & 0 deletions test-adapter/_testadapter/tink_unittest/Injector.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class Injector {
public static function buildRunner():Array<Field> {
var fields = Context.getBuildFields();
var coverageEnabled:Null<String> = Context.definedValue("instrument-coverage");
#if disable_attributable_coverage
coverageEnabled = null;
#end
for (field in fields) {
switch (field.name) {
case "run":
Expand Down
3 changes: 3 additions & 0 deletions test-adapter/_testadapter/utest/Injector.hx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class Injector {
// skip coverage modifications when buddy is enabled
coverageEnabled = null;
#end
#if disable_attributable_coverage
coverageEnabled = null;
#end
var baseFolder = haxe.io.Path.join([_testadapter.data.Data.FOLDER]);
for (field in fields) {
switch (field.name) {
Expand Down

0 comments on commit 3b209ba

Please sign in to comment.