summaryrefslogtreecommitdiff
path: root/testing/tools/safetynet_job.py
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-08-22 11:03:33 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-22 15:42:56 +0000
commite6f3fccc1c8c90867e0d779bf26337a0db1b1e90 (patch)
tree9d0264c8297907d46d3917eb461423bb20da9231 /testing/tools/safetynet_job.py
parent39fa751f84bc226c22d65c2fc5e7d3615dfe5ddb (diff)
downloadpdfium-e6f3fccc1c8c90867e0d779bf26337a0db1b1e90.tar.xz
Prepare safetynet_job.py to have its output sent in emails
- Add --no-color option. - Fix exit code ambiguity (2 means bad usage) Change-Id: I04be9c3f21b5a71857b7847b3cc32bf595084994 Reviewed-on: https://pdfium-review.googlesource.com/11490 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'testing/tools/safetynet_job.py')
-rwxr-xr-xtesting/tools/safetynet_job.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/testing/tools/safetynet_job.py b/testing/tools/safetynet_job.py
index 5cb926aec9..f3ea9c5d9a 100755
--- a/testing/tools/safetynet_job.py
+++ b/testing/tools/safetynet_job.py
@@ -60,7 +60,7 @@ class JobRun(object):
Returns:
Exit code for the script: 0 if no significant changes are found; 1 if
- there was an error in the comparison; 2 if there was a regression; 3 if
+ there was an error in the comparison; 3 if there was a regression; 4 if
there was an improvement and no regression.
"""
pdfium_src_dir = os.path.join(
@@ -144,18 +144,19 @@ class JobRun(object):
output_info = json.loads(json_output)
PrintConclusionsDictHumanReadable(output_info,
- colored=(not self.args.output_to_log),
+ colored=(not self.args.output_to_log
+ and not self.args.no_color),
key='after')
status = 0
if output_info['summary']['improvement']:
PrintWithTime('Improvement detected.')
- status = 3
+ status = 4
if output_info['summary']['regression']:
PrintWithTime('Regression detected.')
- status = 2
+ status = 3
if status == 0:
PrintWithTime('Nothing detected.')
@@ -183,6 +184,9 @@ def main():
parser.add_argument('--no-checkpoint', action='store_true',
help='whether to skip writing the new checkpoint. Use '
'for script debugging.')
+ parser.add_argument('--no-color', action='store_true',
+ help='whether to write output without color escape '
+ 'codes.')
parser.add_argument('--output-to-log', action='store_true',
help='whether to write output to a log file')
args = parser.parse_args()