@@ -21,13 +21,15 @@ root_directory="$PWD"
21
21
data_directory=" $root_directory /src/test/resources/org/metafacture/metafix/integration"
22
22
gradle_command=" $root_directory /../gradlew"
23
23
24
+ flux_command=" $METAFACTURE_HOME /flux.sh"
25
+
24
26
function parse_boolean() {
25
27
[ " ${1,,} " == true ]
26
28
}
27
29
28
30
parse_boolean " $METAFACTURE_INTEGRATION_TEST_DISABLE_TO_DO " && disable_todo=1 || disable_todo=
29
31
parse_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=
31
33
parse_boolean " $CI " && ci=1 || ci=
32
34
33
35
[ -t 1 -a -x /usr/bin/colordiff ] && colordiff=colordiff || colordiff=cat
@@ -74,8 +76,19 @@ function rm_temp() {
74
76
}
75
77
76
78
function 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 " " $@ "
79
92
}
80
93
81
94
function run_catmandu() {
@@ -229,7 +242,7 @@ function run_tests() {
229
242
230
243
metafix_start_time=$( current_time)
231
244
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 "
233
246
metafix_exit_status=$?
234
247
235
248
metafix_elapsed_time=$( elapsed_time " $metafix_start_time " )
@@ -276,6 +289,8 @@ function run_tests() {
276
289
return $matched
277
290
}
278
291
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
+
279
294
start_time=$( current_time)
280
295
281
296
if [ $# -eq 0 ]; then
0 commit comments