Example #1
0
    def test_find_user_attributes(self):
        code = """
// vunit: .foo
// vunit: .foo-bar
        """
        attributes = _find_attributes(code, file_name="file.vhd")

        self.assertEqual(
            attributes,
            [
                Attribute(".foo", None, _code_file_location(code, ".foo", "file.vhd")),
                Attribute(".foo-bar", None, _code_file_location(code, ".foo-bar", "file.vhd")),
            ],
        )
Example #2
0
    def test_find_attributes(self):
        code = """
// vunit: run_all_in_same_sim
// vunit:fail_on_warning
        """

        attributes = _find_attributes(code, file_name="file.vhd")
        self.assertEqual(
            attributes,
            [
                Attribute(
                    "run_all_in_same_sim",
                    None,
                    _code_file_location(code, "run_all_in_same_sim", "file.vhd"),
                ),
                Attribute(
                    "fail_on_warning",
                    None,
                    _code_file_location(code, "fail_on_warning", "file.vhd"),
                ),
            ],
        )