This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
let x = 1
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = 1
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
(library (name foo))
|
||||
|
||||
(include_subdirs unqualified)
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.1)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
$ dune build
|
||||
File "dune", line 1, characters 0-0:
|
||||
Error: Module "X" appears in several directories:
|
||||
- _build/default/a
|
||||
- _build/default/b
|
||||
This is not allowed, please rename one of them.
|
||||
[1]
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(include_subdirs unqualified)
|
||||
(include_subdirs unqualified)
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.1)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
$ dune build
|
||||
File "dune", line 2, characters 0-29:
|
||||
2 | (include_subdirs unqualified)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Error: The 'include_subdirs' stanza cannot appear more than once
|
||||
[1]
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(executable
|
||||
(name main)
|
||||
(libraries foo))
|
||||
|
||||
(alias
|
||||
(name default)
|
||||
(action (run ./main.exe)))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.1)
|
||||
|
|
@ -0,0 +1 @@
|
|||
let () = print_endline Foo.x
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
$ dune build
|
||||
File "src/gen/dune", line 1, characters 0-23:
|
||||
1 | (executable (name gen))
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Error: This stanza is not allowed in a sub-directory of directory with
|
||||
(include_subdirs unqualified).
|
||||
Hint: add (include_subdirs no) to this file.
|
||||
[1]
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = "world!"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
(library (name foo))
|
||||
|
||||
(rule (with-stdout-to generated.ml (run gen/gen.exe)))
|
||||
|
||||
(include_subdirs unqualified)
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = Generated.x ^ Blah.x
|
||||
|
|
@ -0,0 +1 @@
|
|||
(executable (name gen))
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = print_endline {|let x = "Hello, "|}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
include_subdirs should not recurse past project root
|
||||
|
||||
$ cat >dune-project <<EOF
|
||||
> (lang dune 3.1)
|
||||
> EOF
|
||||
|
||||
$ cat >dune <<EOF
|
||||
> (include_subdirs unqualified)
|
||||
> (executable
|
||||
> (name foo))
|
||||
> EOF
|
||||
|
||||
$ cat >foo.ml <<EOF
|
||||
> print_endline Bar.v;;
|
||||
> EOF
|
||||
|
||||
$ mkdir subproj
|
||||
$ cat >subproj/bar.ml <<EOF
|
||||
> let v = "unusable"
|
||||
> EOF
|
||||
|
||||
Works if [subproj] is just a separate directory and not a separate project.
|
||||
|
||||
$ dune exec ./foo.exe
|
||||
unusable
|
||||
|
||||
$ cat >subproj/dune-project <<EOF
|
||||
> (lang dune 3.1)
|
||||
> EOF
|
||||
|
||||
Doesn't work with when we make [subproj] a separate project with a dune-project
|
||||
file, since include_subdirs is stopped.
|
||||
|
||||
$ dune exec ./foo.exe
|
||||
File "foo.ml", line 1, characters 14-19:
|
||||
1 | print_endline Bar.v;;
|
||||
^^^^^
|
||||
Error: Unbound module Bar
|
||||
[1]
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
(alias
|
||||
(name default)
|
||||
(action (run src/foo.exe)))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.1)
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Simple test with a multi dir exe
|
||||
--------------------------------
|
||||
|
||||
$ dune build
|
||||
Hello, world!
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = "Hello, "
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = "world!"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(executable (name foo))
|
||||
(include_subdirs unqualified)
|
||||
|
|
@ -0,0 +1 @@
|
|||
let () = prerr_endline X.x
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = Y.x ^ Z.x
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(executable
|
||||
(name main)
|
||||
(libraries foo))
|
||||
|
||||
(alias
|
||||
(name default)
|
||||
(action (run ./main.exe)))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.1)
|
||||
|
|
@ -0,0 +1 @@
|
|||
let () = print_endline Foo.x
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Test that include_subdirs stop the recursion
|
||||
--------------------------------------------
|
||||
|
||||
$ dune build
|
||||
Hello, world!
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = "world!"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
(library (name foo))
|
||||
|
||||
(rule (with-stdout-to generated.ml (run gen/gen.exe)))
|
||||
|
||||
(include_subdirs unqualified)
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = Generated.x ^ Blah.x
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(executable (name gen))
|
||||
(include_subdirs no)
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = print_endline {|let x = "Hello, "|}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
(test
|
||||
(name main)
|
||||
(libraries foo)
|
||||
(modules main))
|
||||
|
||||
(library
|
||||
(name foo)
|
||||
(modules foo)
|
||||
(c_names stub1 sub/stub2))
|
||||
|
||||
(include_subdirs unqualified)
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.1)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
external x : unit -> string = "dune_test_x"
|
||||
external y : unit -> string = "dune_test_y"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
#include <caml/mlvalues.h>
|
||||
#include <caml/alloc.h>
|
||||
|
|
@ -0,0 +1 @@
|
|||
let () = print_endline (Foo.x () ^ Foo.y ())
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
Test with C stubs in sub-directories
|
||||
------------------------------------
|
||||
|
||||
$ dune runtest
|
||||
File "dune", line 9, characters 16-25:
|
||||
9 | (c_names stub1 sub/stub2))
|
||||
^^^^^^^^^
|
||||
Error: Relative part of stub is not necessary and should be removed. To
|
||||
include sources in subdirectories, use the (include_subdirs ...) stanza.
|
||||
[1]
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#include "include/dune_test.h"
|
||||
|
||||
CAMLprim value dune_test_x()
|
||||
{
|
||||
return caml_copy_string("Hello,");
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#include "../include/dune_test.h"
|
||||
|
||||
CAMLprim value dune_test_y()
|
||||
{
|
||||
return caml_copy_string(" world!");
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
(executable
|
||||
(name main)
|
||||
(modules main))
|
||||
|
||||
(library
|
||||
(name foo)
|
||||
(preprocess (action (run ./main.exe %{input-file})))
|
||||
(modules foo))
|
||||
|
||||
(include_subdirs unqualified)
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.9)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
let () =
|
||||
print_endline "print_endline \"foo\""
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Test for (include_subdir unqualified) with (preprocess (action ...))
|
||||
--------------------------------------------------------------------
|
||||
|
||||
$ dune exec ./main.exe @all
|
||||
print_endline "foo"
|
||||
Loading…
Add table
Add a link
Reference in a new issue