|
| 1 | +In this test we check a cycle when a library depends on a genrated source file which in |
| 2 | +turn depends on the inline-test-name alias of the inline tests of the library. |
| 3 | + |
| 4 | + $ cat >dune-project <<EOF |
| 5 | + > (lang dune 3.18) |
| 6 | + > EOF |
| 7 | + |
| 8 | + $ cat >test.ml <<EOF |
| 9 | + > (*TEST: assert (1 = 2) *) |
| 10 | + > EOF |
| 11 | + |
| 12 | + $ cat >dune <<EOF |
| 13 | + > (library |
| 14 | + > (name backend_simple) |
| 15 | + > (modules ()) |
| 16 | + > (inline_tests.backend |
| 17 | + > (generate_runner (run sed "s/(\\\\*TEST:\\\\(.*\\\\)\\\\*)/let () = if \\"%{inline_tests}\\" = \\"enabled\\" then \\\\1;;/" %{impl-files})))) |
| 18 | + > |
| 19 | + > (library |
| 20 | + > (name foo_simple) |
| 21 | + > (inline_tests (backend backend_simple))) |
| 22 | + > |
| 23 | + > (rule |
| 24 | + > (deps |
| 25 | + > (alias runtest-foo_simple)) |
| 26 | + > (action |
| 27 | + > (with-outputs-to bar.ml |
| 28 | + > (echo "let message = \"Hello world\"")))) |
| 29 | + > EOF |
| 30 | + |
| 31 | +This kind of cycle has a difficult to understand error message. |
| 32 | + $ dune build 2>&1 | grep -vwE "sed" |
| 33 | + File "dune", lines 7-9, characters 0-69: |
| 34 | + 7 | (library |
| 35 | + 8 | (name foo_simple) |
| 36 | + 9 | (inline_tests (backend backend_simple))) |
| 37 | + Error: Dependency cycle between: |
| 38 | + _build/default/.foo_simple.objs/foo_simple__Bar.impl.all-deps |
| 39 | + -> _build/default/.foo_simple.objs/byte/foo_simple__Bar.cmi |
| 40 | + -> _build/default/.foo_simple.inline-tests/.t.eobjs/byte/dune__exe__Main.cmi |
| 41 | + -> _build/default/.foo_simple.inline-tests/.t.eobjs/native/dune__exe__Main.cmx |
| 42 | + -> _build/default/.foo_simple.inline-tests/inline-test-runner.exe |
| 43 | + -> alias runtest-foo_simple in dune:9 |
| 44 | + -> _build/default/bar.ml |
| 45 | + -> _build/default/.foo_simple.objs/foo_simple__Bar.impl.d |
| 46 | + -> _build/default/.foo_simple.objs/foo_simple__Bar.impl.all-deps |
| 47 | + -> required by _build/default/.foo_simple.objs/byte/foo_simple__Bar.cmo |
| 48 | + -> required by _build/default/foo_simple.cma |
| 49 | + -> required by alias all |
| 50 | + -> required by alias default |
0 commit comments