Skip to content

Commit

Permalink
lib/tests/phoronix-test-suite.sh: handle TimesToRun not set in test-d…
Browse files Browse the repository at this point in the history
…efinition.xml

The test-definition.xml of some benchmarks don't have explicit
TimesToRun parameter, so set them to run 3 times in this situation.

/var/lib/phoronix-test-suite/test-profiles/pts/build-imagemagick-1.7.2$ grep TimesToRun test-definition.xml
<-- nothing

== fix issue ==

failed to force times to run of build-imagemagick-1.7.2

Signed-off-by: Yujie Liu <[email protected]>
Signed-off-by: Philip Li <[email protected]>
  • Loading branch information
Yujie-Liu authored and rli9 committed May 10, 2024
1 parent 651ee6f commit 03a371f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tests/phoronix-test-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ force_times_to_run()
local target=${environment_directory}/../test-profiles/pts/${test}/test-definition.xml
if [[ -f $target ]]; then
local times_to_run=$(grep -oP '(?<=<TimesToRun>).*(?=</TimesToRun>)' $target)
[[ $times_to_run ]] && log_cmd export FORCE_TIMES_TO_RUN=$times_to_run
if [[ $times_to_run ]]; then
log_cmd export FORCE_TIMES_TO_RUN=$times_to_run
else
log_cmd export FORCE_TIMES_TO_RUN=3
fi
else
log_cmd export FORCE_TIMES_TO_RUN=3
fi
Expand Down

0 comments on commit 03a371f

Please sign in to comment.