Add new option build_type to packager_test.py

Change-Id: Ifb1109b48e2d93e81561c3e71c5512052851bb56
This commit is contained in:
KongQun Yang 2016-01-07 11:29:19 -08:00 committed by Gerrit Code Review
parent 62a70e71ee
commit 43d5a9ef6e
2 changed files with 8 additions and 6 deletions

View File

@ -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):

View File

@ -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