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

Side by Side Diff: tools/isolate/tests/gtest_fake/gtest_fake_fail.py

Issue 11045023: Move src/tools/isolate to src/tools/swarm_client as a DEPS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use r159961 Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Simulate a failing google-test executable.
7
8 http://code.google.com/p/googletest/
9 """
10
11 import optparse
12 import sys
13
14 import gtest_fake_base
15
16
17 TESTS = {
18 'Foo': ['Bar1', 'Bar2', 'Bar3'],
19 'Baz': ['Fail'],
20 }
21 TOTAL = sum(len(v) for v in TESTS.itervalues())
22
23
24 def main():
25 parser = optparse.OptionParser()
26 parser.add_option('--gtest_list_tests', action='store_true')
27 parser.add_option('--gtest_filter')
28 options, args = parser.parse_args()
29 if args:
30 parser.error('Failed to process args %s' % args)
31
32 if options.gtest_list_tests:
33 for fixture, cases in TESTS.iteritems():
34 print '%s.' % fixture
35 for case in cases:
36 print ' ' + case
37 print ' YOU HAVE 2 tests with ignored failures (FAILS prefix)'
38 print ''
39 return 0
40
41 if options.gtest_filter:
42 # Simulate running one test.
43 print 'Note: Google Test filter = %s\n' % options.gtest_filter
44 print gtest_fake_base.get_test_output(options.gtest_filter)
45 print gtest_fake_base.get_footer(1, 1)
46 # Make Baz.Fail fail.
47 return options.gtest_filter == 'Baz.Fail'
48
49 for fixture, cases in TESTS.iteritems():
50 for case in cases:
51 print gtest_fake_base.get_test_output('%s.%s' % (fixture, case))
52 print gtest_fake_base.get_footer(TOTAL, TOTAL)
53 return 1
54
55
56 if __name__ == '__main__':
57 sys.exit(main())
OLDNEW
« no previous file with comments | « tools/isolate/tests/gtest_fake/gtest_fake_error.py ('k') | tools/isolate/tests/gtest_fake/gtest_fake_pass.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698