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

Side by Side Diff: mojo/tools/apptest_runner.py

Issue 1057603003: Simplify mojo_shell since it's now only used for Mandoline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update scripts Created 5 years, 8 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/tools/android_mojo_shell.py ('k') | mojo/tools/gtest.py » ('j') | 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 """A test runner for gtest application tests.""" 6 """A test runner for gtest application tests."""
7 7
8 import argparse 8 import argparse
9 import ast 9 import ast
10 import logging 10 import logging
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 # TODO(msw): Run some apptests without fixture isolation? 52 # TODO(msw): Run some apptests without fixture isolation?
53 fixtures = gtest.get_fixtures(mojo_shell_path, apptest) 53 fixtures = gtest.get_fixtures(mojo_shell_path, apptest)
54 54
55 if not fixtures: 55 if not fixtures:
56 print "Failed with no tests found." 56 print "Failed with no tests found."
57 exit_code = 1 57 exit_code = 1
58 continue 58 continue
59 59
60 apptest_result = "Succeeded" 60 apptest_result = "Succeeded"
61 for fixture in fixtures: 61 for fixture in fixtures:
62 args_for_apptest = " ".join(["--args-for=" + apptest, 62 args_for_apptest = " ".join(["--gtest_filter=" + fixture] + apptest_args)
63 "--gtest_filter=" + fixture] + apptest_args)
64 63
65 success = RunApptestInShell(mojo_shell_path, apptest, 64 success = RunApptestInShell(mojo_shell_path, apptest,
66 shell_args + [args_for_apptest]) 65 shell_args + [args_for_apptest])
67 66
68 if not success: 67 if not success:
69 apptest_result = "Failed test(s) in %r" % apptest_dict 68 apptest_result = "Failed test(s) in %r" % apptest_dict
70 exit_code = 1 69 exit_code = 1
71 70
72 print apptest_result 71 print apptest_result
73 72
74 return exit_code 73 return exit_code
75 74
76 75
77 def RunApptestInShell(mojo_shell_path, apptest, shell_args): 76 def RunApptestInShell(mojo_shell_path, apptest, shell_args):
78 return gtest.run_test([mojo_shell_path, apptest] + shell_args) 77 return gtest.run_test([mojo_shell_path, apptest] + shell_args)
79 78
80 79
81 if __name__ == '__main__': 80 if __name__ == '__main__':
82 sys.exit(main()) 81 sys.exit(main())
OLDNEW
« no previous file with comments | « mojo/tools/android_mojo_shell.py ('k') | mojo/tools/gtest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698