From 0da39e6b62fe7dc0f40d5242325b3b2d5b2c9d96 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Tue, 15 Aug 2017 14:37:58 -0400 Subject: Make errors in called processes more evident and easier to debug. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also trying to get unicode filenames right again. Change-Id: I501c94921b92b8a8cd6a10441aff1595fc6d878e Reviewed-on: https://pdfium-review.googlesource.com/10630 Commit-Queue: Henrique Nakashima Reviewed-by: Nicolás Peña Reviewed-by: Ryan Harrison --- testing/tools/safetynet_measure.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'testing/tools/safetynet_measure.py') diff --git a/testing/tools/safetynet_measure.py b/testing/tools/safetynet_measure.py index 67c07349e3..7b5bd5fe9d 100755 --- a/testing/tools/safetynet_measure.py +++ b/testing/tools/safetynet_measure.py @@ -14,6 +14,8 @@ import re import subprocess import sys +from common import PrintErr + CALLGRIND_PROFILER = 'callgrind' PERFSTAT_PROFILER = 'perfstat' @@ -30,12 +32,13 @@ class PerformanceRun(object): def _CheckTools(self): """Returns whether the tool file paths are sane.""" if not os.path.exists(self.pdfium_test_path): - print "FAILURE: Can't find test executable '%s'" % self.pdfium_test_path - print 'Use --build-dir to specify its location.' + PrintErr("FAILURE: Can't find test executable '%s'" + % self.pdfium_test_path) + PrintErr('Use --build-dir to specify its location.') return False if not os.access(self.pdfium_test_path, os.X_OK): - print ("FAILURE: Test executable '%s' lacks execution permissions" - % self.pdfium_test_path) + PrintErr("FAILURE: Test executable '%s' lacks execution permissions" + % self.pdfium_test_path) return False return True @@ -53,7 +56,7 @@ class PerformanceRun(object): elif self.args.profiler == PERFSTAT_PROFILER: time = self._RunPerfStat() else: - print 'profiler=%s not supported, aborting' % self.args.profiler + PrintErr('profiler=%s not supported, aborting' % self.args.profiler) return 1 if time is None: @@ -142,7 +145,7 @@ def main(): args = parser.parse_args() if args.interesting_section and args.profiler != CALLGRIND_PROFILER: - print '--interesting-section requires profiler to be callgrind.' + PrintErr('--interesting-section requires profiler to be callgrind.') return 1 run = PerformanceRun(args) -- cgit v1.2.3