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,3 @@
(alias
(name runtest)
(deps %{project_root}/023e1a58-4d08-11e7-a041-aa000008c8a6))

View file

@ -0,0 +1,42 @@
;; Test for %{deps} with globs in rules
(rule
(targets result expected)
(deps dune (glob_files *.txt))
(action (progn
(with-stdout-to result (echo %{deps}))
(with-stdout-to expected (echo "dune a.txt b.txt c.txt")))))
(rule
(targets result2 expected2)
(deps (source_tree sub-tree))
(action (progn
(with-stdout-to result2 (echo %{deps}))
(with-stdout-to expected2 (echo "sub-tree/a sub-tree/dir/b")))))
(alias
(name runtest)
(deps result expected)
(action (run diff -u result expected)))
(alias
(name runtest)
(deps result2 expected2)
(action (run diff -u result2 expected2)))
;; For some tests in subdirs
(rule (with-stdout-to 023e1a58-4d08-11e7-a041-aa000008c8a6 (echo "plop")))
;; Test for globs
(alias
(name runtest)
(deps (glob_files dir-that-doesnt-exist/*)))
;; Check that %{ocaml_bin} expands to a directory and not a path
(alias
(name runtest)
(action (ignore-stdout (echo %{ocaml_bin}))))

View file

@ -0,0 +1,3 @@
(lang dune 1.0)
(package (name toto))

View file

@ -0,0 +1,49 @@
$ dune runtest --display short
diff alias runtest
diff alias runtest
Test that incompatible options are properly reported
----------------------------------------------------
$ dune build --verbose --display quiet
dune: Cannot use --verbose and --display simultaneously
Usage: dune build [OPTION] [TARGET]
Try 'dune build --help' or 'dune --help' for more information.
[1]
$ dune build -p toto --root .
dune: option '--root' cannot be repeated
Usage: dune build [OPTION] [TARGET]
Try 'dune build --help' or 'dune --help' for more information.
[1]
$ dune build --for-release-of-packages toto --root .
dune: option '--root' cannot be repeated
Usage: dune build [OPTION] [TARGET]
Try 'dune build --help' or 'dune --help' for more information.
[1]
$ dune build --no-config --config x
dune: Cannot use --config and --no-config simultaneously
Usage: dune build [OPTION] [TARGET]
Try 'dune build --help' or 'dune --help' for more information.
[1]
$ dune build -p toto --release
dune: option '--root' cannot be repeated
Usage: dune build [OPTION] [TARGET]
Try 'dune build --help' or 'dune --help' for more information.
[1]
$ dune build --release --root .
dune: option '--root' cannot be repeated
Usage: dune build [OPTION] [TARGET]
Try 'dune build --help' or 'dune --help' for more information.
[1]
Allowed combinations
--------------------
$ dune build --release --only-packages toto
$ dune build --release --only-packages toto --profile foo