diff options
author | 2015-09-28 15:32:38 +0000 | |
---|---|---|
committer | 2015-09-30 09:31:44 +0000 | |
commit | 08fdffc17ebd424369c445bd11c7b23ac50e152a (patch) | |
tree | c941cfbda6951c981d5094281689f5c7c51bd320 /src/test/shell/unittest.bash | |
parent | c14b35c901c8f5b53b27918f7e9bb22f36b7c93e (diff) |
Fix a long standing issue where in the presence of '{' or '\' characters in the test log output we would fails to report the tests that failed (and show the whole raw output instead). This is because we inline a text inside a perl program but we were only escaping } character.
--
MOS_MIGRATED_REVID=104102328
Diffstat (limited to 'src/test/shell/unittest.bash')
-rw-r--r-- | src/test/shell/unittest.bash | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/shell/unittest.bash b/src/test/shell/unittest.bash index fc2321afee..2430e928ec 100644 --- a/src/test/shell/unittest.bash +++ b/src/test/shell/unittest.bash @@ -426,8 +426,8 @@ function __trap_with_arg() { # arguments need to be escaped. function __log_to_test_report() { local node="$1" - local block="${2//\}/\\\}}" - + # Escape '\', '{' and '}' character, since we are inlining the text in the perl expression. + local block=$(echo "$2" | sed -e 's/\([\{\}\\]\)/\\\1/g') if [[ ! -e "$XML_OUTPUT_FILE" ]]; then local xml_header='<?xml version="1.0" encoding="UTF-8"?>' echo "$xml_header<testsuites></testsuites>" > $XML_OUTPUT_FILE |