Esempio n. 1
0
    def setUp(self):
        setupTestSuport(TEST_TEMP_PATH)

        _logger.debug("Creating server")
        tx_r, tx_w = os.pipe()
        self.tx_stream_reader = JsonRpcStreamReader(os.fdopen(tx_r, "rb"))

        rx_stream = MagicMock()
        rx_stream.closed = False

        self.server = lsp.HdlCheckerLanguageServer(rx_stream, os.fdopen(tx_w, "wb"))

        # Initialize server
        _logger.info("Calling m_initialize")
        self.assertEqual(
            self.server.m_initialize(**(self.params or {})),
            {
                "capabilities": {
                    "textDocumentSync": 1,
                    "definitionProvider": True,
                    "hoverProvider": True,
                    "referencesProvider": True,
                }
            },
        )

        _logger.info("Calling m_initialized")
        with patch("hdl_checker.lsp.onNewReleaseFound"):
            self.assertIsNone(self.server.m_initialized())
Esempio n. 2
0
        def setup(handle_ui_info):
            setupTestSuport(TEST_TEMP_PATH)

            removeIfExists(p.join(TEST_TEMP_PATH, WORK_PATH, CACHE_NAME))

            with PatchBuilder():
                it.project = DummyServer(_Path(TEST_TEMP_PATH))
                it.project.setConfig(Path(p.join(TEST_PROJECT, "vimhdl.prj")))
                it.project._updateConfigIfNeeded()
                handle_ui_info.assert_called_once_with("Added 10 sources")

            _logger.info("Database state:\n%s",
                         pformat(it.project.database.__jsonEncode__()))

            it.assertTrue(it.project.database.paths)
            it.assertIsInstance(it.project.builder, MockBuilder)
Esempio n. 3
0
        def setup():
            setupTestSuport(TEST_TEMP_PATH)

            it.project = DummyServer(_Path(TEST_TEMP_PATH))

            it.config_file = _makeConfigFromDict({
                "builder": MockBuilder.builder_name,
                FileType.vhdl.value: {
                    "flags": {
                        BuildFlagScope.all.value: (
                            "-globalvhdl",
                            "-global-vhdl-flag",
                        ),
                        BuildFlagScope.dependencies.value: ("--vhdl-batch", ),
                        BuildFlagScope.single.value:
                        ("-single_build_flag_0", ),
                    }
                },
                FileType.verilog.value: {
                    "flags": {
                        BuildFlagScope.all.value: (
                            "-globalverilog",
                            "-global-verilog-flag",
                        ),
                        BuildFlagScope.dependencies.value:
                        ("--verilog-batch", ),
                        BuildFlagScope.single.value:
                        ("-single_build_flag_0", ),
                    }
                },
                FileType.systemverilog.value: {
                    "flags": {
                        BuildFlagScope.all.value: (
                            "-globalsystemverilog",
                            "-global-systemverilog-flag",
                        ),
                        BuildFlagScope.dependencies.value:
                        ("--systemverilog-batch", ),
                        BuildFlagScope.single.value:
                        ("-single_build_flag_0", ),
                    }
                },
            })

            it.project.setConfig(it.config_file)
Esempio n. 4
0
    def setup():
        setupTestSuport(TEST_TEMP_PATH)

        it.project_file = p.join(TEST_PROJECT, "vimhdl.prj")
        it.app = TestApp(handlers.app)
Esempio n. 5
0
 def setUpClass(cls):
     setupTestSuport(TEST_TEMP_PATH)
Esempio n. 6
0
 def setup():
     setupTestSuport(TEST_TEMP_PATH)
Esempio n. 7
0
 def setup():
     # type: (...) -> Any
     setupTestSuport(TEST_TEMP_PATH)