Debian Codegraph @

test/blackbox-tests/test-cases/pkg/ocamllsp/dev-tool-ocamllsp-basic.t

raw
1 Test that the "dune tools exec ocamllsp" command causes ocamllsp to be
2 locked, built and run when the command is run from a dune project with
3 a lockdir containing an "ocaml" lockfile.
4
5 $ mkrepo
6 $ make_mock_ocamllsp_package
7 $ mk_ocaml 5.2.0
8 $ setup_ocamllsp_workspace
9
10 $ cat > dune-project <<EOF
11 > (lang dune 3.16)
12 >
13 > (package
14 > (name foo)
15 > (allow_empty)
16 > (depends
17 > (ocaml (= 5.2.0))))
18 > EOF
19
20 $ dune build
21
22 $ dune tools exec ocamllsp
23 Solution for _build/.dev-tools.locks/ocaml-lsp-server:
24 - ocaml-base-compiler.5.2.0
25 - ocaml-compiler.5.2.0
26 - ocaml-lsp-server.0.0.1
27 Running 'ocamllsp'
28 hello from fake ocamllsp
29
30 Make sure that after evaling the output of 'dune tools env', the first ocamllsp
31 executable in PATH is the one installed by dune as a dev tool.
32 $ DUNE_CONFIG__LOCK_DEV_TOOL=enabled eval $(dune tools env)
33 $ which ocamllsp
34 $TESTCASE_ROOT/_build/_private/default/.dev-tool/ocaml-lsp-server/target/bin/ocamllsp