From e30945a820b4353c94df1a7b347390d999786d7b Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 14 Mar 2023 17:53:21 -0700 Subject: [PATCH] report: pass property value to _xunit_add_property Change this helper to require the caller to pass the value as the second parameter. This prepares us to start reporting a lot more information about a test run, not all of which are encoded as bash variables. Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- common/report | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/report b/common/report index 3ec2d881..2ab83928 100644 --- a/common/report +++ b/common/report @@ -29,12 +29,13 @@ encode_cdata() _xunit_add_property() { local name="$1" - local value="${!name}" + local value="$2" - if [ ! -z "$value" ]; then - echo -e "\t\t" - fi + test -z "$value" && return + + echo -e "\t\t" } + _xunit_make_section_report() { # xfstest:section ==> xunit:testsuite @@ -76,7 +77,7 @@ ENDL # Properties echo -e "\t" >> $REPORT_DIR/result.xml for p in "${REPORT_ENV_LIST[@]}"; do - _xunit_add_property "$p" + _xunit_add_property "$p" "${!p}" done | sort >> $REPORT_DIR/result.xml echo -e "\t" >> $REPORT_DIR/result.xml if [ -f $report ]; then -- 2.39.5