From 43d5a9ef6ed2c4ef68f01b8620389010eb524559 Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Thu, 7 Jan 2016 11:29:19 -0800 Subject: [PATCH] Add new option build_type to packager_test.py Change-Id: Ifb1109b48e2d93e81561c3e71c5512052851bb56 --- packager/app/test/packager_app.py | 9 ++++----- packager/app/test/test_env.py | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packager/app/test/packager_app.py b/packager/app/test/packager_app.py index e1bc58155a..41d56c93ad 100644 --- a/packager/app/test/packager_app.py +++ b/packager/app/test/packager_app.py @@ -18,13 +18,12 @@ import test_env class PackagerApp(object): """Main integration class for testing the packager binary.""" - def __init__(self, build_type='Debug'): - self.build_dir = os.path.join(test_env.SRC_DIR, 'out', build_type) + def __init__(self): + self.build_dir = os.path.join(test_env.SRC_DIR, 'out', + test_env.options.build_type) self.binary = os.path.join(self.build_dir, 'packager') - def BuildSrc(self, clean=False): - if clean: - return subprocess.call(['ninja', '-C', self.build_dir, '-t', 'clean']) + def BuildSrc(self): return subprocess.call(['ninja', '-C', self.build_dir]) def DumpStreamInfo(self, stream): diff --git a/packager/app/test/test_env.py b/packager/app/test/test_env.py index c32343ccfb..dfd9a2961e 100644 --- a/packager/app/test/test_env.py +++ b/packager/app/test/test_env.py @@ -25,6 +25,10 @@ SRC_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../..') # Parse arguments and calculate dynamic global objects and attributes. parser = argparse.ArgumentParser() + +parser.add_argument('--build_type', default='Debug') +parser.add_argument('--test_update_golden_files', default=0, type=int) + aes = parser.add_argument_group( 'aes flags', 'These flags are required to enable AES signed encryption tests.') @@ -34,7 +38,6 @@ rsa = parser.add_argument_group( 'rsa flags', 'These flags are required to enable RSA signed encryption tests.') rsa.add_argument('--rsa_signing_key_path') -parser.add_argument('--test_update_golden_files', default=0, type=int) options, args = parser.parse_known_args() sys.argv[1:] = args