diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-06-25 08:10:33 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-06-25 08:10:33 +0200 |
commit | d0e40cd550e584b641525fa99a6a07ac316750aa (patch) | |
tree | 6cf94f715d2a3b1e5d16e90a58c9286d7b622667 /testsuite/pyunit/lsp | |
parent | 5cf1931ab101124df92566de5c8d1a54f89658b4 (diff) | |
download | ghdl-d0e40cd550e584b641525fa99a6a07ac316750aa.tar.gz ghdl-d0e40cd550e584b641525fa99a6a07ac316750aa.tar.bz2 ghdl-d0e40cd550e584b641525fa99a6a07ac316750aa.zip |
Add a readme in testsuite/pyunit/lsp
Diffstat (limited to 'testsuite/pyunit/lsp')
-rw-r--r-- | testsuite/pyunit/lsp/README | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/pyunit/lsp/README b/testsuite/pyunit/lsp/README new file mode 100644 index 000000000..054a6630f --- /dev/null +++ b/testsuite/pyunit/lsp/README @@ -0,0 +1,45 @@ +# To run the LSP testsuite +Assuming pyGHDL is installed (Hint: use pip install -U -e), + +> pytest + +or + +> pytest-3 + + +# To add a test + +Enable traces: + +> export GHDL_LS_TRACE=ghdl-ls + +Run the session + +> code . +(or your preferred editor) + +This creates two files (or more): `ghdl-ls.in` and `ghdl-ls.out` +Those are raw dumps of the LSP data. + +Create a new test directory (increment the number): + +> mkdir 099mytest +> cd 099mytest + +Transforms those files in json (which are easier to read and to process): + +> python3 -m pyGHDL.lsp.lsptools lsp2json < xxx/ghdl-ls.in > cmds.json +> python3 -m pyGHDL.lsp.lsptools lsp2json < xxx/ghdl-ls.out > replies.json + +Substitute the root directory with `@ROOT@` (for privacy and relocation): + +> sed -i -e 's!/home/me/test!@ROOT@' cmds.json +> sed -i -e 's!/home/me/test!@ROOT@' replies.json + +Attention: the uri must ends with a `/` (you will be notified if not) + +Add a test in LanguageServer.py (use existing tests as a template) + +Adjust or improve this file. + |