From 4d81979b1629403f48433219aa1a7e1a114e6f9e Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Tue, 25 Apr 2017 12:29:28 -0700 Subject: [PATCH] Add -v and --vmodule flags in test script The flags will be propagated to packager binary if set. Change-Id: I38aa9f4fb8e23f7a802d4114b5507035ef0cc583 --- packager/app/test/packager_app.py | 7 +++++++ packager/app/test/test_env.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/packager/app/test/packager_app.py b/packager/app/test/packager_app.py index 6f8b9ef4ad..21736af546 100644 --- a/packager/app/test/packager_app.py +++ b/packager/app/test/packager_app.py @@ -37,11 +37,18 @@ class PackagerApp(object): return subprocess.check_output([self.binary, '--version']) def Package(self, streams, flags=None): + """Executes packager command.""" if flags is None: flags = [] cmd = [self.binary] cmd.extend(streams) cmd.extend(flags) + + if test_env.options.v: + cmd.extend(['--v=%s' % test_env.options.v]) + if test_env.options.vmodule: + cmd.extend(['--vmodule="%s"' % test_env.options.vmodule]) + # Put single-quotes around each entry so that things like '$' signs in # segment templates won't be interpreted as shell variables. self.packaging_command_line = ' '.join(["'%s'" % entry for entry in cmd]) diff --git a/packager/app/test/test_env.py b/packager/app/test/test_env.py index caa33f5e8b..3420a3f7e9 100644 --- a/packager/app/test/test_env.py +++ b/packager/app/test/test_env.py @@ -27,6 +27,8 @@ SRC_DIR = os.path.join(SCRIPT_DIR, os.pardir, os.pardir) parser = argparse.ArgumentParser() parser.add_argument('--test_update_golden_files', default=0, type=int) +parser.add_argument('--v') +parser.add_argument('--vmodule') # Overwrite the test to encryption key/iv specified in the command line. parser.add_argument('--encryption_key') parser.add_argument('--encryption_iv')