From 7b6c758ff1da554485f51fa404b5e4ffcf4bf491 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 17 Oct 2016 10:33:11 +0200 Subject: [PATCH] TT#4590 generate unique id for JUNIT output Change-Id: Id4a60f8abd7dd1a308ca1d1e980b7fad599d50c7 --- run_tests.sh | 29 ++++++++++++++++++++++------- t/testrunner | 2 -- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index 2efcd5f..530661b 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,6 +1,7 @@ #!/bin/bash RESULTS=${RESULTS:-.} +ID=0 if [ -z "${FORMAT}" ] ; then FORMAT=TAP @@ -16,10 +17,20 @@ esac mkdir -p "${RESULTS}"/reports rm -rf "${RESULTS}"/reports/* +# unique id across files +# See TT#4590 +function fix_id() { + (( ID += 1)) + local tmp_id + tmp_id=$(printf "%05d\n" "$ID") + sed -i "s/id=\"00001\"/id=\"$tmp_id\"/" "$1" +} + function do_test() { - echo "testing $1 -> ${RESULTS}/reports/${1}.${EXT}" + local RES="${RESULTS}/reports/${1}.${EXT}" + echo "testing $1 -> ${RES}" if ${OUT_FORCE} ; then - cat< ${RESULTS}/reports/${1}.${EXT} + cat< "${RES}" EXPORT_ASSERT_TO_GLOBALS = true require "tests/${1}" ---- Control test output: @@ -29,23 +40,27 @@ lu:setVerbosity(1) lu:run() EOF else - cat<