aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Michajlo Matijkiw <michajlo@google.com>2015-09-29 16:28:42 +0000
committerGravatar Florian Weikert <fwe@google.com>2015-09-30 09:35:24 +0000
commitc5993f8da2a9da8732fce876a36fdcf53499ca20 (patch)
treeb0153c6a46c06bacda24b571f2b23cee9ff13098 /src
parentb00b7ac4c16d5c9e2bab8bf7508bc64e188be861 (diff)
Pass test log as argument to formatting perl program instead of inlining
No need to worry about escaping any perl-related chars. RELNOTES: -- MOS_MIGRATED_REVID=104207407
Diffstat (limited to 'src')
-rw-r--r--src/test/shell/unittest.bash7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/test/shell/unittest.bash b/src/test/shell/unittest.bash
index 2430e928ec..ace16fd4ee 100644
--- a/src/test/shell/unittest.bash
+++ b/src/test/shell/unittest.bash
@@ -426,8 +426,7 @@ function __trap_with_arg() {
# arguments need to be escaped.
function __log_to_test_report() {
local node="$1"
- # Escape '\', '{' and '}' character, since we are inlining the text in the perl expression.
- local block=$(echo "$2" | sed -e 's/\([\{\}\\]\)/\\\1/g')
+ local block="$2"
if [[ ! -e "$XML_OUTPUT_FILE" ]]; then
local xml_header='<?xml version="1.0" encoding="UTF-8"?>'
echo "$xml_header<testsuites></testsuites>" > $XML_OUTPUT_FILE
@@ -436,7 +435,7 @@ function __log_to_test_report() {
# replace match on node with block and match
# replacement expression only needs escaping for quotes
perl -e "\
-\$input = q{$block}; \
+\$input = @ARGV[0]; \
\$/=undef; \
open FILE, '+<$XML_OUTPUT_FILE'; \
\$content = <FILE>; \
@@ -444,7 +443,7 @@ if (\$content =~ /($node.*)\$/) { \
seek FILE, 0, 0; \
print FILE \$\` . \$input . \$1; \
}; \
-close FILE"
+close FILE" "$block"
}
# Usage: <total> <passed>