Escape the test failure log in scripted tests
authorJan Lahoda <jlahoda@netbeans.org>
Sun, 23 Jun 2013 13:20:03 +0200
changeset 9647ad2db2a7ba7
parent 963 60544a6e8938
child 965 cec9f7dfcd43
Escape the test failure log in scripted tests
cmdline/test/scripted/harness
     1.1 --- a/cmdline/test/scripted/harness	Sun Jun 02 20:59:47 2013 +0200
     1.2 +++ b/cmdline/test/scripted/harness	Sun Jun 23 13:20:03 2013 +0200
     1.3 @@ -87,12 +87,13 @@
     1.4  }
     1.5  
     1.6  write_failure_results_file() {
     1.7 +      ESCAPED_CONTENT=`echo $X | sed -e 's/&/\&amp;/g' | sed -e 's/</\&lt;/g'`;
     1.8        cat >$RESULT_FILE <<EOF
     1.9  <?xml version="1.0" encoding="UTF-8" ?>
    1.10  <testsuite errors="0" failures="1" hostname="foo" name="$TEST_NAME" tests="1" time="0" timestamp="`date`">
    1.11    <properties/>
    1.12    <testcase classname="$TEST_NAME" name="main" time="0">
    1.13 -    <failure message="Test failed" type="junit.framework.AssertionFailedError">$1</failure>
    1.14 +    <failure message="Test failed" type="junit.framework.AssertionFailedError">$ESCAPED_CONTENT</failure>
    1.15    </testcase>
    1.16  </testsuite>
    1.17  EOF