def test_filter_testcases_by_status_second_pass(self):
        suite = TestSuite('foo', 'bar')

        suite.rules = {
            '': {
                'foo/bar': set(['PREV']),
            },
            'default': {
                'foo/bar': set(['PASS', 'SKIP']),
                'baz/bar': set(['PASS', 'FAIL']),
            },
            'stress': {
                'baz/bar': set(['SKIP']),
            },
        }
        suite.prefix_rules = {
            '': {
                'baz/': set(['PREV']),
            },
            'default': {
                'baz/': set(['PASS', 'SLOW']),
            },
            'stress': {
                'foo/': set(['PASS', 'SLOW']),
            },
        }

        test1 = TestCase(suite, 'foo/bar', 'foo/bar')
        test2 = TestCase(suite, 'baz/bar', 'baz/bar')
        suite.tests = [
            test1.create_variant(variant='default', flags=[]),
            test1.create_variant(variant='stress', flags=['-v']),
            test2.create_variant(variant='default', flags=[]),
            test2.create_variant(variant='stress', flags=['-v']),
        ]

        suite.FilterTestCasesByStatus()
        self.assertEquals(
            [
                TestCase(suite, 'foo/bar', 'foo/bar').create_variant(
                    None, ['-v']),
                TestCase(suite, 'baz/bar', 'baz/bar'),
            ],
            suite.tests,
        )

        self.assertEquals(
            set(['PREV', 'PASS', 'SLOW']),
            suite.GetStatusFileOutcomes(suite.tests[0].name,
                                        suite.tests[0].variant),
        )
        self.assertEquals(
            set(['PREV', 'PASS', 'FAIL', 'SLOW']),
            suite.GetStatusFileOutcomes(suite.tests[1].name,
                                        suite.tests[1].variant),
        )
Ejemplo n.º 2
0
 def test_filter_testcases_by_status_first_pass(self):
     suite = TestSuite('foo', 'bar')
     suite.tests = [
         TestCase(suite, 'foo/bar', 'foo/bar'),
         TestCase(suite, 'baz/bar', 'baz/bar'),
     ]
     suite.rules = {
         '': {
             'foo/bar': set(['PASS', 'SKIP']),
             'baz/bar': set(['PASS', 'FAIL']),
         },
     }
     suite.prefix_rules = {
         '': {
             'baz/': set(['PASS', 'SLOW']),
         },
     }
     suite.FilterTestCasesByStatus()
     self.assertEquals(
         [TestCase(suite, 'baz/bar', 'baz/bar')],
         suite.tests,
     )
     outcomes = suite.GetStatusFileOutcomes(suite.tests[0].name,
                                            suite.tests[0].variant)
     self.assertEquals(set(['PASS', 'FAIL', 'SLOW']), outcomes)