Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Unified Diff: ios/build/bots/scripts/run.py

Issue 2262733004: Add iOS device test runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Minor fixes Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ios/build/bots/scripts/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/build/bots/scripts/run.py
diff --git a/ios/build/bots/scripts/run.py b/ios/build/bots/scripts/run.py
index 929f3f81802fd978ba0fae47f62afa951e6691fa..4eaa732102a135c725aa8b596f9191c6ac83f4d8 100755
--- a/ios/build/bots/scripts/run.py
+++ b/ios/build/bots/scripts/run.py
@@ -33,15 +33,25 @@ def main(args, test_args):
os.makedirs(args.out_dir)
try:
- tr = test_runner.SimulatorTestRunner(
- args.app,
- args.iossim,
- args.platform,
- args.version,
- args.xcode_version,
- args.out_dir,
- test_args=test_args,
- )
+ if args.iossim and args.platform and args.version:
+ tr = test_runner.SimulatorTestRunner(
+ args.app,
+ args.iossim,
+ args.platform,
+ args.version,
+ args.xcode_version,
+ args.out_dir,
+ env_vars=args.env_var,
+ test_args=test_args,
+ )
+ else:
+ tr = test_runner.DeviceTestRunner(
+ args.app,
+ args.xcode_version,
+ args.out_dir,
+ env_vars=args.env_var,
+ test_args=test_args,
+ )
return 0 if tr.launch() else 1
except test_runner.TestRunnerError as e:
@@ -72,11 +82,17 @@ if __name__ == '__main__':
required=True,
)
parser.add_argument(
+ '-e',
+ '--env-var',
+ action='append',
+ help='Environment variable to pass to the test itself.',
+ metavar='ENV=val',
+ )
+ parser.add_argument(
'-i',
'--iossim',
help='Compiled iossim to run the app on.',
metavar='iossim',
- required=True,
)
parser.add_argument(
'-o',
@@ -90,14 +106,12 @@ if __name__ == '__main__':
'--platform',
help='Platform to simulate.',
metavar='sim',
- required=True,
)
parser.add_argument(
'-v',
'--version',
help='Version of iOS the simulator should run.',
metavar='ver',
- required=True,
)
parser.add_argument(
'-x',
@@ -107,4 +121,12 @@ if __name__ == '__main__':
required=True,
)
- sys.exit(main(*parser.parse_known_args()))
+ args, test_args = parser.parse_known_args()
+ if args.iossim or args.platform or args.version:
+ # If any of --iossim, --platform, or --version
+ # are specified then they must all be specified.
+ if not (args.iossim and args.platform and args.version):
+ parser.error(
+ 'must specify all or none of -i/--iossim, -p/--platform, -v/--version')
+
+ sys.exit(main(args, test_args))
« no previous file with comments | « no previous file | ios/build/bots/scripts/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698