From e9fcf01b3d3c08bba662aa3bc43a2b363115a870 Mon Sep 17 00:00:00 2001 From: Herman Venter Date: Wed, 26 Jun 2013 15:38:05 -0700 Subject: [PATCH] Encode test ouput before returning it to the test framework When a test fails hphp/test/run runs a regular expression over the test output and returns it to the python scripts that is running the tests on the continuous build machine. These scripts crash if presented with output that is not printable ASCII, which makes it very difficult to figure out why the test is failing. This change modifies hphp/test/run to first encode the test output with quoted_printable_encode before returning it to the python scripts. --- hphp/runtime/debugger/break_point.cpp | 1 + hphp/test/run | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hphp/runtime/debugger/break_point.cpp b/hphp/runtime/debugger/break_point.cpp index 6a901b5a4..489a774f7 100644 --- a/hphp/runtime/debugger/break_point.cpp +++ b/hphp/runtime/debugger/break_point.cpp @@ -13,6 +13,7 @@ | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ +// force test run #include "hphp/runtime/debugger/break_point.h" #include "hphp/runtime/debugger/debugger.h" diff --git a/hphp/test/run b/hphp/test/run index 40348b072..2177fe3b9 100755 --- a/hphp/test/run +++ b/hphp/test/run @@ -573,7 +573,7 @@ function run_test($options, $test) { # a poor man's aide for debugging shell_exec("diff --text -u $test.expectf $test.out > $test.diff 2>&1"); - return preg_match("/^$wanted_re\$/s", $output); + return quoted_printable_encode(preg_match("/^$wanted_re\$/s", $output)); } else if (file_exists("$test.expectregex")) { $wanted_re = file_get_contents("$test.expectregex"); @@ -581,7 +581,7 @@ function run_test($options, $test) { # a poor man's aide for debugging shell_exec("diff --text -u $test.expectregex $test.out > $test.diff 2>&1"); - return preg_match("/^$wanted_re\$/s", $output); + return quoted_printable_encode(preg_match("/^$wanted_re\$/s", $output)); } }