From f24fc1e69d77db16527de99bff192693878f4080 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Thu, 3 Aug 2017 13:29:22 -0400 Subject: Add script to compare performance of two versions of pdfium. Run from the pdfium root: $ testing/tools/safetynet_compare.py testing This compares the current branch with and without local changes. $ testing/tools/safetynet_compare.py testing/corpus --branch-before x This compares the current branch + local changes against branch x. It runs only the corpus tests. $ testing/tools/safetynet_compare.py testing --branch-before x --branch-after y --build-dir=~/output_compare This compares branch x and branch y. x and y can be revision hashes. The callgrind.out files of cases with significant changes will be created in ~/output_compare. $ testing/tools/safetynet_compare.py -h Print all options. Change-Id: I43aaf5fe890745db611fb3bc00a656ef799fdfef Reviewed-on: https://pdfium-review.googlesource.com/7390 Reviewed-by: Lei Zhang Commit-Queue: Henrique Nakashima --- testing/tools/common.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'testing/tools/common.py') diff --git a/testing/tools/common.py b/testing/tools/common.py index b6e4a7d62e..c3bc2181f4 100755 --- a/testing/tools/common.py +++ b/testing/tools/common.py @@ -5,6 +5,7 @@ import glob import os +import re import subprocess import sys @@ -96,3 +97,14 @@ class DirectoryFinder: if other_components: result = os.path.join(result, other_components) return result + + +def GetBooleanGnArg(arg_name, build_dir): + '''Extract the value of a boolean flag in args.gn''' + cwd = os.getcwd() + os.chdir(build_dir) + gn_args_output = subprocess.check_output( + ['gn', 'args', '.', '--list=%s' % arg_name, '--short']) + os.chdir(cwd) + arg_match_output = re.search('%s = (.*)' % arg_name, gn_args_output).group(1) + return arg_match_output == 'true' -- cgit v1.2.3