aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/pyunit/lsp/README
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/pyunit/lsp/README')
-rw-r--r--testsuite/pyunit/lsp/README45
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..ec8f614e2
--- /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):
+(The root directory is the parent directory of the test, so it is
+ xxx/ghdl/testsuite/pyunit/lsp)
+
+> sed -i -e 's!/home/me/test!@ROOT@' cmds.json
+> sed -i -e 's!/home/me/test!@ROOT@' replies.json
+
+Add a test in LanguageServer.py (use existing tests as a template)
+
+Adjust or improve this file.
+