This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,2 @@
(executable
(name foo))

View file

@ -0,0 +1,3 @@
int bla () {
return 0;
}

View file

@ -0,0 +1,3 @@
(library
(name foo)
(c_names bar))

View file

@ -0,0 +1,29 @@
Check that the @check alias builds:
- the merlin file
- the cmi/cmo/cmt files
A test should be considered successful if it prints the .merlin files
as well as the foo.{cmi,cmo,cmt} files.
$ build_check_and_list_interesting_files_in ()
> (
> cd $1
> dune build @check
> find _build \( -name '*.cm*' -o -name '.merlin-conf' \) | awk -F/ '{ print $NF }' | LANG=C sort
> )
Test the property for executables:
$ build_check_and_list_interesting_files_in exe
.merlin-conf
foo.cmi
foo.cmo
foo.cmt
Test the property for libraries:
$ build_check_and_list_interesting_files_in lib
.merlin-conf
foo.cmi
foo.cmo
foo.cmt

View file

@ -0,0 +1,37 @@
The @check alias should detect dependency cycles
$ cat >dune-project <<EOF
> (lang dune 3.2)
> EOF
$ cat >dune <<EOF
> (library (name foo))
> EOF
$ cat >a.ml <<EOF
> module B = B
> EOF
$ touch b.ml b.mli a.mli
$ dune build @all
$ cat >b.ml <<EOF
> module A = A
> EOF
$ dune build @check
Error: dependency cycle between modules in _build/default:
B
-> A
-> B
-> required by alias check
[1]
$ dune build @all
Error: dependency cycle between modules in _build/default:
B
-> A
-> B
-> required by _build/default/foo.cma
-> required by alias all
[1]