コード例 #1
0
 def test_add_skipped_tests(self):
     port = MockHost().port_factory.get('qt')
     port._filesystem.files[port._filesystem.join(
         port.layout_tests_dir(),
         'platform/qt/Skipped')] = 'failures/expected/text.html'
     port._filesystem.files[port._filesystem.join(
         port.layout_tests_dir(), 'failures/expected/text.html')] = 'foo'
     self.assertRaises(ParseError, TestExpectations, port,
                       'failures/expected/text.html\n',
                       'BUGX : failures/expected/text.html = text\n', None,
                       True)
コード例 #2
0
    def check(self, expectations, overrides, skips, lint=False):
        port = MockHost().port_factory.get('mac')
        port._filesystem.write_text_file(
            port._filesystem.join(port.layout_tests_dir(),
                                  'failures/expected/text.html'), 'foo')
        expectations_dict = OrderedDict()
        expectations_dict['expectations'] = expectations
        if overrides:
            expectations_dict['overrides'] = overrides
        port.expectations_dict = lambda: expectations_dict
        port.skipped_layout_tests = lambda tests: set(skips)
        expectations_to_lint = expectations_dict if lint else None
        exp = TestExpectations(port, ['failures/expected/text.html'],
                               expectations_to_lint=expectations_to_lint)
        exp.parse_all_expectations()

        # Check that the expectation is for BUG_DUMMY SKIP : ... [ Pass ]
        self.assertEqual(
            exp.model().get_modifiers('failures/expected/text.html'), [
                TestExpectationParser.DUMMY_BUG_MODIFIER,
                TestExpectationParser.SKIP_MODIFIER,
                TestExpectationParser.WONTFIX_MODIFIER
            ])
        self.assertEqual(
            exp.model().get_expectations('failures/expected/text.html'),
            set([PASS]))
コード例 #3
0
 def test_add_skipped_tests(self):
     port = MockHost().port_factory.get('qt')
     port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'platform/qt/Skipped')] = 'failures/expected/text.html'
     port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html')] = 'foo'
     expectations = TestExpectations(port, tests=['failures/expected/text.html'], expectations='', test_config=port.test_configuration())
     self.assertEquals(expectations.get_modifiers('failures/expected/text.html'), [TestExpectationParser.DUMMY_BUG_MODIFIER, TestExpectationParser.SKIP_MODIFIER])
     self.assertEquals(expectations.get_expectations('failures/expected/text.html'), set([FAIL]))
コード例 #4
0
    def check(self, expectations, overrides, skips, lint=False):
        port = MockHost().port_factory.get('qt')
        port._filesystem.write_text_file(port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html'), 'foo')
        exp = TestExpectations(port, tests=['failures/expected/text.html'],
                               expectations=expectations, overrides=overrides, is_lint_mode=lint,
                               test_config=port.test_configuration(), skipped_tests=set(skips))

        # Check that the expectation is for BUG_DUMMY SKIP : ... = PASS
        self.assertEquals(exp.get_modifiers('failures/expected/text.html'),
                          [TestExpectationParser.DUMMY_BUG_MODIFIER, TestExpectationParser.SKIP_MODIFIER])
        self.assertEquals(exp.get_expectations('failures/expected/text.html'), set([PASS]))
コード例 #5
0
 def check(self, expectations, overrides, skips, lint=False, expected_results=[WONTFIX, SKIP, FAIL]):
     port = MockHost().port_factory.get('test-win-xp')
     port._filesystem.write_text_file(port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html'), 'foo')
     expectations_dict = OrderedDict()
     expectations_dict['expectations'] = expectations
     if overrides:
         expectations_dict['overrides'] = overrides
     port.expectations_dict = lambda: expectations_dict
     port.skipped_layout_tests = lambda tests: set(skips)
     expectations_to_lint = expectations_dict if lint else None
     exp = TestExpectations(port, ['failures/expected/text.html'], expectations_dict=expectations_to_lint, is_lint_mode=lint)
     self.assertEqual(exp.get_expectations('failures/expected/text.html'), set(expected_results))
コード例 #6
0
 def test_add_skipped_tests_duplicate(self):
     port = MockHost().port_factory.get("qt")
     port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), "failures/expected/text.html")] = "foo"
     self.assertRaises(
         ParseError,
         TestExpectations,
         port,
         tests=["failures/expected/text.html"],
         expectations="BUGX : failures/expected/text.html = text\n",
         test_config=port.test_configuration(),
         is_lint_mode=True,
         skipped_tests=set(["failures/expected/text.html"]),
     )
コード例 #7
0
    def check(self, expectations, overrides, skips, lint=False):
        port = MockHost().port_factory.get('qt')
        port._filesystem.write_text_file(port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html'), 'foo')
        expectations_dict = OrderedDict()
        expectations_dict['expectations'] = expectations
        if overrides:
            expectations_dict['overrides'] = overrides
        port.expectations_dict = lambda: expectations_dict
        port.skipped_layout_tests = lambda tests: set(skips)
        exp = TestExpectations(port, ['failures/expected/text.html'], lint)

        # Check that the expectation is for BUG_DUMMY SKIP : ... [ Pass ]
        self.assertEquals(exp.get_modifiers('failures/expected/text.html'),
                          [TestExpectationParser.DUMMY_BUG_MODIFIER, TestExpectationParser.SKIP_MODIFIER, TestExpectationParser.WONTFIX_MODIFIER])
        self.assertEquals(exp.get_expectations('failures/expected/text.html'), set([PASS]))
コード例 #8
0
 def test_add_skipped_tests(self):
     port = MockHost().port_factory.get("qt")
     port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), "failures/expected/text.html")] = "foo"
     expectations = TestExpectations(
         port,
         tests=["failures/expected/text.html"],
         expectations="",
         test_config=port.test_configuration(),
         skipped_tests=set(["failures/expected/text.html"]),
     )
     self.assertEquals(
         expectations.get_modifiers("failures/expected/text.html"),
         [TestExpectationParser.DUMMY_BUG_MODIFIER, TestExpectationParser.SKIP_MODIFIER],
     )
     self.assertEquals(expectations.get_expectations("failures/expected/text.html"), set([PASS]))
コード例 #9
0
    def check(self, expectations, overrides, skips, lint=False):
        port = MockHost().port_factory.get('qt')
        port._filesystem.write_text_file(
            port._filesystem.join(port.layout_tests_dir(),
                                  'failures/expected/text.html'), 'foo')
        port.test_expectations = lambda: expectations
        port.test_expectations_overrides = lambda: overrides
        port.skipped_layout_tests = lambda tests: set(skips)
        exp = TestExpectations(port, ['failures/expected/text.html'], lint)

        # Check that the expectation is for BUG_DUMMY SKIP : ... = PASS
        self.assertEquals(exp.get_modifiers('failures/expected/text.html'), [
            TestExpectationParser.DUMMY_BUG_MODIFIER,
            TestExpectationParser.SKIP_MODIFIER
        ])
        self.assertEquals(exp.get_expectations('failures/expected/text.html'),
                          set([PASS]))
コード例 #10
0
    def check(self, expectations, overrides, skips, lint=False):
        port = MockHost().port_factory.get("test-win-xp")
        port._filesystem.write_text_file(
            port._filesystem.join(port.layout_tests_dir(), "failures/expected/text.html"), "foo"
        )
        expectations_dict = OrderedDict()
        expectations_dict["expectations"] = expectations
        if overrides:
            expectations_dict["overrides"] = overrides
        port.expectations_dict = lambda: expectations_dict
        port.skipped_layout_tests = lambda tests: set(skips)
        expectations_to_lint = expectations_dict if lint else None
        exp = TestExpectations(port, ["failures/expected/text.html"], expectations_to_lint=expectations_to_lint)

        # Check that the expectation is for BUG_DUMMY SKIP : ... [ Pass ]
        self.assertEqual(
            exp.get_modifiers("failures/expected/text.html"),
            [
                TestExpectationParser.DUMMY_BUG_MODIFIER,
                TestExpectationParser.SKIP_MODIFIER,
                TestExpectationParser.WONTFIX_MODIFIER,
            ],
        )
        self.assertEqual(exp.get_expectations("failures/expected/text.html"), set([PASS]))
コード例 #11
0
 def test_add_skipped_tests(self):
     port = MockHost().port_factory.get('qt')
     port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'platform/qt/Skipped')] = 'failures/expected/text.html'
     port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html')] = 'foo'
     self.assertRaises(ParseError, TestExpectations, port, 'failures/expected/text.html\n', 'BUGX : failures/expected/text.html = text\n', None, True)
コード例 #12
0
 def test_add_skipped_tests_duplicate(self):
     port = MockHost().port_factory.get('qt')
     port._filesystem.files[port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html')] = 'foo'
     self.assertRaises(ParseError, TestExpectations, port, tests=['failures/expected/text.html'], expectations='BUGX : failures/expected/text.html = text\n', test_config=port.test_configuration(), is_lint_mode=True, skipped_tests=set(['failures/expected/text.html']))