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

Side by Side Diff: tools/testrunner/local/testsuite_unittest.py

Issue 2216293002: [test] Fix merging of test outcomes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/testrunner/objects/testcase.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 2016 the V8 project authors. All rights reserved. 2 # Copyright 2016 the V8 project 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 import os 6 import os
7 import sys 7 import sys
8 import unittest 8 import unittest
9 9
10 # Needed because the test runner contains relative imports. 10 # Needed because the test runner contains relative imports.
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 suite.FilterTestCasesByStatus(warn_unused_rules=False) 37 suite.FilterTestCasesByStatus(warn_unused_rules=False)
38 self.assertEquals( 38 self.assertEquals(
39 [TestCase(suite, 'baz/bar')], 39 [TestCase(suite, 'baz/bar')],
40 suite.tests, 40 suite.tests,
41 ) 41 )
42 self.assertEquals(set(['PASS', 'FAIL', 'SLOW']), suite.tests[0].outcomes) 42 self.assertEquals(set(['PASS', 'FAIL', 'SLOW']), suite.tests[0].outcomes)
43 43
44 def test_filter_testcases_by_status_second_pass(self): 44 def test_filter_testcases_by_status_second_pass(self):
45 suite = TestSuite('foo', 'bar') 45 suite = TestSuite('foo', 'bar')
46 suite.tests = [ 46
47 TestCase(suite, 'foo/bar', variant='default'), 47 test1 = TestCase(suite, 'foo/bar')
48 TestCase(suite, 'foo/bar', variant='stress', flags=['-v']), 48 test2 = TestCase(suite, 'baz/bar')
49 TestCase(suite, 'baz/bar', variant='default'),
50 TestCase(suite, 'baz/bar', variant='stress', flags=['-v']),
51 ]
52 49
53 # Contrived outcomes from filtering by variant-independent rules. 50 # Contrived outcomes from filtering by variant-independent rules.
54 suite.tests[0].outcomes = set(['PREV']) 51 test1.outcomes = set(['PREV'])
55 suite.tests[1].outcomes = set(['PREV']) 52 test2.outcomes = set(['PREV'])
56 suite.tests[2].outcomes = set(['PREV']) 53
57 suite.tests[3].outcomes = set(['PREV']) 54 suite.tests = [
Michael Achenbach 2016/08/05 09:02:41 Btw: This test change reveals the problem.
55 test1.CopyAddingFlags(variant='default', flags=[]),
56 test1.CopyAddingFlags(variant='stress', flags=['-v']),
57 test2.CopyAddingFlags(variant='default', flags=[]),
58 test2.CopyAddingFlags(variant='stress', flags=['-v']),
59 ]
58 60
59 suite.rules = { 61 suite.rules = {
60 'default': { 62 'default': {
61 'foo/bar': set(['PASS', 'SKIP']), 63 'foo/bar': set(['PASS', 'SKIP']),
62 'baz/bar': set(['PASS', 'FAIL']), 64 'baz/bar': set(['PASS', 'FAIL']),
63 }, 65 },
64 'stress': { 66 'stress': {
65 'baz/bar': set(['SKIP']), 67 'baz/bar': set(['SKIP']),
66 }, 68 },
67 } 69 }
(...skipping 19 matching lines...) Expand all
87 suite.tests[0].outcomes, 89 suite.tests[0].outcomes,
88 ) 90 )
89 self.assertEquals( 91 self.assertEquals(
90 set(['PASS', 'FAIL', 'SLOW', 'PREV']), 92 set(['PASS', 'FAIL', 'SLOW', 'PREV']),
91 suite.tests[1].outcomes, 93 suite.tests[1].outcomes,
92 ) 94 )
93 95
94 96
95 if __name__ == '__main__': 97 if __name__ == '__main__':
96 unittest.main() 98 unittest.main()
OLDNEW
« no previous file with comments | « no previous file | tools/testrunner/objects/testcase.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698