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

Side by Side Diff: mojo/devtools/common/mojo_test

Issue 1302493002: Explicitly require rooted device in `mojo_test`. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « mojo/devtools/common/devtoolslib/shell_config.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Test runner for Mojo application tests. 6 """Test runner for Mojo application tests.
7 7
8 TODO(vtl|msw): Add a way of specifying data dependencies. 8 TODO(vtl|msw): Add a way of specifying data dependencies.
9 """ 9 """
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 formatter_class=argparse.RawDescriptionHelpFormatter, 55 formatter_class=argparse.RawDescriptionHelpFormatter,
56 description=_DESCRIPTION) 56 description=_DESCRIPTION)
57 parser.add_argument("test_list_file", type=file, 57 parser.add_argument("test_list_file", type=file,
58 help="a file listing apptests to run") 58 help="a file listing apptests to run")
59 shell_config.add_shell_arguments(parser) 59 shell_config.add_shell_arguments(parser)
60 60
61 script_args, shell_args = parser.parse_known_args() 61 script_args, shell_args = parser.parse_known_args()
62 62
63 try: 63 try:
64 config = shell_config.get_shell_config(script_args) 64 config = shell_config.get_shell_config(script_args)
65 if script_args.android:
66 # We need root to have the stdout of the shell available on the host.
67 config.require_root = True
65 shell, common_shell_args = shell_arguments.get_shell(config, shell_args) 68 shell, common_shell_args = shell_arguments.get_shell(config, shell_args)
66 except shell_config.ShellConfigurationException as e: 69 except shell_config.ShellConfigurationException as e:
67 print e 70 print e
68 return 1 71 return 1
69 72
70 target_os = "android" if script_args.android else "linux" 73 target_os = "android" if script_args.android else "linux"
71 test_list_globals = {"target_os": target_os} 74 test_list_globals = {"target_os": target_os}
72 exec script_args.test_list_file in test_list_globals 75 exec script_args.test_list_file in test_list_globals
73 test_list = test_list_globals["tests"] 76 test_list = test_list_globals["tests"]
74 77
(...skipping 26 matching lines...) Expand all
101 print "Unrecognized test type in %r" % test_dict 104 print "Unrecognized test type in %r" % test_dict
102 105
103 print "Succeeded" if apptest_result else "Failed" 106 print "Succeeded" if apptest_result else "Failed"
104 _logger.info("Completed: %s" % test_name) 107 _logger.info("Completed: %s" % test_name)
105 if not apptest_result: 108 if not apptest_result:
106 succeeded = False 109 succeeded = False
107 return 0 if succeeded else 1 110 return 0 if succeeded else 1
108 111
109 if __name__ == '__main__': 112 if __name__ == '__main__':
110 sys.exit(main()) 113 sys.exit(main())
OLDNEW
« no previous file with comments | « mojo/devtools/common/devtoolslib/shell_config.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698