diff --git a/framework/core/Constants.pm b/framework/core/Constants.pm index b5fd92992..92a3988fb 100644 --- a/framework/core/Constants.pm +++ b/framework/core/Constants.pm @@ -48,7 +48,7 @@ our @ISA = qw(Exporter); my $dir = dirname(abs_path(__FILE__)); # Enable debugging and verbose output -our $DEBUG = 0; +our $DEBUG = $ENV{'D4J_DEBUG'} // 0; =pod @@ -232,8 +232,6 @@ unshift(@INC, $SCRIPT_DIR); unshift(@INC, $LIB_DIR); # Append Major's executables to the PATH -> ant may not be installed by default $ENV{PATH}="$ENV{PATH}:$MAJOR_ROOT/bin"; -# set name of mml file that provides definitions of used mutation operators -$ENV{MML}="$MAJOR_ROOT/mml/all_mutants.mml.bin" unless defined $ENV{'MML'}; # Constant strings used for errors our $ARG_ERROR = "Invalid number of arguments!"; diff --git a/framework/core/Project.pm b/framework/core/Project.pm index ad51d739a..b156cddba 100644 --- a/framework/core/Project.pm +++ b/framework/core/Project.pm @@ -767,7 +767,11 @@ sub mutate { $ENV{MML} = $mml_bin; # Mutate and compile sources - if (! $self->_call_major("mutate")) { + my $ret = $self->_call_major("mutate"); + + delete($ENV{MML}); + + if (! $ret) { return -1; } @@ -1031,9 +1035,14 @@ sub _call_major { @_ >= 2 or die $ARG_ERROR; my ($self, $target, $option_str, $log_file, $ant_cmd) = @_; $option_str = "-Dbuild.compiler=major.ant.MajorCompiler " . ($option_str // ""); + # Prepend path with Major's executables + my $path = $ENV{PATH}; $ENV{PATH}="$MAJOR_ROOT/bin:$ENV{PATH}"; $ant_cmd = "$MAJOR_ROOT/bin/ant" unless defined $ant_cmd; - return $self->_ant_call($target, $option_str, $log_file, $ant_cmd); + my $ret = $self->_ant_call($target, $option_str, $log_file, $ant_cmd); + # Reset path for downstream calls to ant + $ENV{PATH} = $path; + return($ret); } # diff --git a/framework/projects/defects4j.build.xml b/framework/projects/defects4j.build.xml index 03aee7ce5..0ed95311e 100644 --- a/framework/projects/defects4j.build.xml +++ b/framework/projects/defects4j.build.xml @@ -60,6 +60,8 @@ project-specific build file ("project_id"/"project_id".build.xml) for the + + @@ -143,7 +145,7 @@ project-specific build file ("project_id"/"project_id".build.xml) for the - + @@ -184,7 +186,7 @@ project-specific build file ("project_id"/"project_id".build.xml) for the - + @@ -229,7 +231,7 @@ project-specific build file ("project_id"/"project_id".build.xml) for the - + @@ -254,10 +256,10 @@ project-specific build file ("project_id"/"project_id".build.xml) for the - - + + @@ -288,7 +290,7 @@ project-specific build file ("project_id"/"project_id".build.xml) for the - +