Ejemplo n.º 1
0
    def test_does_not_associate_tests_and_legacy_attributes(self):
        code = """\
        if run("test1")
// vunit_pragma run_all_in_same_sim
// vunit_pragma fail_on_warning
        """
        (test1, ), attributes = _find_tests_and_attributes(
            code, file_name="file.vhd")

        self.assertEqual(
            attributes,
            [
                LegacyAttribute(
                    "run_all_in_same_sim",
                    None,
                    _code_file_location(code, "run_all_in_same_sim",
                                        "file.vhd"),
                ),
                LegacyAttribute(
                    "fail_on_warning",
                    None,
                    _code_file_location(code, "fail_on_warning", "file.vhd"),
                ),
            ],
        )

        self.assertEqual(test1.name, "test1")
        self.assertEqual(test1.location.file_name, "file.vhd")
        self.assertEqual(test1.location.lineno, 1)
        self.assertEqual(test1.attributes, [])
Ejemplo n.º 2
0
    def test_find_legacy_pragma(self):
        code = """
// vunit_pragma run_all_in_same_sim
// vunit_pragma fail_on_warning
        """
        attributes = _find_attributes(code, file_name="file.vhd")

        self.assertEqual(attributes, [
            LegacyAttribute(
                "run_all_in_same_sim", None,
                _code_file_location(code, 'run_all_in_same_sim', "file.vhd")),
            LegacyAttribute(
                "fail_on_warning", None,
                _code_file_location(code, 'fail_on_warning', "file.vhd"))
        ])