@@ -21,13 +21,15 @@ root_directory="$PWD"
2121data_directory=" $root_directory /src/test/resources/org/metafacture/metafix/integration"
2222gradle_command=" $root_directory /../gradlew"
2323
24+ flux_command=" $METAFACTURE_HOME /flux.sh"
25+
2426function parse_boolean() {
2527 [ " ${1,,} " == true ]
2628}
2729
2830parse_boolean " $METAFACTURE_INTEGRATION_TEST_DISABLE_TO_DO " && disable_todo=1 || disable_todo=
2931parse_boolean " $METAFACTURE_INTEGRATION_TEST_KEEP_TEMP " && keep_temp=1 || keep_temp=
30- parse_boolean " $METAFACTURE_INTEGRATION_TEST_PROFILE " && noprofile= || noprofile=no
32+ parse_boolean " $METAFACTURE_INTEGRATION_TEST_PROFILE " && profile=1 || profile=
3133parse_boolean " $CI " && ci=1 || ci=
3234
3335[ -t 1 -a -x /usr/bin/colordiff ] && colordiff=colordiff || colordiff=cat
@@ -74,8 +76,19 @@ function rm_temp() {
7476}
7577
7678function run_metafix() {
77- local file=$1 ; shift
78- $gradle_command --console=plain -p " $root_directory " :metafacture-runner:run --args=" $file " -P${noprofile} profile=" ${file% .* } " $@
79+ local file=$1 args=$2 opts=(); shift 2
80+
81+ if [ -r " $args " ]; then
82+ opts+=($( < " $args " ) )
83+ fi
84+
85+ if [ -n " $profile " ]; then
86+ # See metafacture-runner/build.gradle (application)
87+ opts+=(" -XX:FlightRecorderOptions=stackdepth=${METAFACTURE_INTEGRATION_TEST_PROFILE_DEPTH:- 8} " )
88+ opts+=(" -XX:StartFlightRecording=dumponexit=true,filename=${file% .* } .jfr,settings=profile" )
89+ fi
90+
91+ FLUX_JAVA_OPTIONS=" ${opts[@]} " $flux_command " $file " " $@ "
7992}
8093
8194function run_catmandu() {
@@ -229,7 +242,7 @@ function run_tests() {
229242
230243 metafix_start_time=$( current_time)
231244
232- run_metafix " $test_directory /$metafix_file " $( cat " $metafix_command_args " 2> /dev/null || true ) > " $metafix_command_output " 2> " $metafix_command_error "
245+ run_metafix " $test_directory /$metafix_file " " $metafix_command_args " > " $metafix_command_output " 2> " $metafix_command_error "
233246 metafix_exit_status=$?
234247
235248 metafix_elapsed_time=$( elapsed_time " $metafix_start_time " )
@@ -276,6 +289,8 @@ function run_tests() {
276289 return $matched
277290}
278291
292+ [ -n " $METAFACTURE_HOME " -a -x " $flux_command " ] || die " Please install the metafacture-core distribution first and set the METAFACTURE_HOME environment variable to its path."
293+
279294start_time=$( current_time)
280295
281296if [ $# -eq 0 ]; then
0 commit comments