Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions test/blackbox-tests/dune
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,15 @@
(action
(run %{bin:shellcheck} -s bash %{deps})))

;; A list of tests that do not contain descriptions. This file should not not
;; grow, only shrink. Once it is empty, it will become an error to introduce
;; tests that do not have a description
;; This rule is here to make sure that all of our tests have descriptions

(rule
(target lacking-description.gen)
(alias runtest)
(enabled_if %{bin-available:rg})
(deps
%{bin:rg}
;; CR-someday rgrinberg: we need a recursive glob for source_tree
(source_tree test-cases))
(action
(system
"rg -L --files-without-match '^\\S' --glob \"*.t\" --glob \"!*coq*\" --glob \"!*rocq*\" --sort=path . > %{target}")))

(rule
(enabled_if %{bin-available:rg})
(alias runtest)
(action
(diff lacking-description lacking-description.gen)))
"rg -L --files-without-match '^\\S' --glob \"*.t\" --glob \"!*coq*\" --glob \"!*rocq*\"; [ $? -eq 1 ]")))
143 changes: 0 additions & 143 deletions test/blackbox-tests/lacking-description

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rejects switch-derived context names that come from absolute paths.

$ cat > dune-project << EOF
> (lang dune 3.0)
> EOF
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests that actions do not inherit stdin by default.

$ echo "(lang dune 2.7)" > dune-project
$ cat >dune <<EOF
> (rule (with-stdout-to file.txt (run cat)))
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/actions/with-exit-codes.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Checks `with-accepted-exit-codes` against matching and failing commands.

$ cat > dune-project << EOF
> (lang dune 2.0)
> (using action-plugin 0.1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Allows nested action modifiers under `with-accepted-exit-codes` in Dune 2.2.

$ cat > dune-project << EOF
> (lang dune 2.2)
> (using action-plugin 0.1)
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/actions/with-stdin-from.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Feeds an action's stdin from a file with `with-stdin-from`.

$ cat > dune-project <<EOF
> (lang dune 2.0)
> EOF
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rejects nested action modifiers under `with-accepted-exit-codes` before Dune 2.2.

$ cat > dune-project << EOF
> (lang dune 2.0)
> (using action-plugin 0.1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Reports bad alias paths given as absolute paths.

$ dune runtest
File "dune", line 4, characters 9-17:
4 | (alias /foo/bar)))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Reports bad alias paths outside the workspace.

$ dune runtest
File "dune", line 4, characters 9-42:
4 | (alias %{workspace_root}/../../../foobar)))
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/block-strings.t/run.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Compares ordinary strings and block strings in actions, including raw escapes.

$ dune build @old
ARFLAGS=rsc
CXX=g++
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/cmdliner-dep-conf.t/run.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests TARGET argument parsing for dependency configurations.

$ dune build "(alias foo)"
Hello!

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests ctypes name mangling for external library names.

$ cat >dune-project <<EOF
> (lang dune 3.7)
> (using ctypes 0.3)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rejects invalid custom cross-compilation configurations.

$ dune build file @install
File "dune-workspace", lines 5-7, characters 9-50:
5 | (context (default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rejects custom cross-compilation contexts with an undefined host.

$ dune build file @install
File "dune-workspace", lines 5-7, characters 9-47:
5 | (context (default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests a basic custom cross-compilation setup.

$ env OCAMLFIND_CONF=$PWD/etc/findlib.conf dune build -x foo file @install --promote-install-files
$ cat _build/default.foo/file
42
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests the default custom cross-compilation context.

$ dune build file @install

$ cat _build/cross/file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rejects contexts that set both targets and host.

$ env OCAMLFIND_CONF=$PWD/etc/findlib.conf dune build file @install
File "dune-workspace", lines 5-8, characters 9-65:
5 | (context (default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rejects topological loops in custom contexts.

$ dune build file @install
File "dune-workspace", lines 13-15, characters 9-50:
13 | (context (default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Avoids false cycle detection when multiple symlinks point to the same tree.

$ echo "(lang dune 2.0)" > dune-project
$ mkdir src
$ ln -s src src-clone
Expand Down
3 changes: 2 additions & 1 deletion test/blackbox-tests/test-cases/cyclic-dep-executable.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Reports module dependency cycles inside executables.

$ cat > dune-project <<EOF
> (lang dune 3.20)
> EOF
Expand Down Expand Up @@ -30,4 +32,3 @@
-> required by alias default
[1]


2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/default-ocaml-flags-3-13.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests the default OCaml flags in Dune 3.13.

$ cat >dune <<EOF
> (library
> (modes byte)
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/depend-on/the-universe.t/run.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests dependencies on the full build universe.

$ dune build @x
Hello, world!
$ dune build @x
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Reports deprecation of allow_approximate_merlin.

$ cat >dune-project <<EOF
> (lang dune 2.7)
> (allow_approximate_merlin true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Expands library artifact variables in alias dependencies.

$ echo >dune <<EOF
> (alias
> (name default)
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/deps-conf-vars/static.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Expands static library artifact variables in dependencies.

$ cat >dune <<EOF
> (alias
> (name default)
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/dialects/bad3.t/run.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rejects dialect extensions that start with a dot.

$ dune build
File "dune-project", line 5, characters 28-32:
5 | (implementation (extension .foo))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests old-style directory targets as dependencies.

$ dune build
Error: No rule found for dir
-> required by alias default in dune:1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests old-style directory targets as explicit targets.

$ dune build && cat _build/default/dir/*
bar contents
foo contents
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Allows `dirs` and `data_only_dirs` to coexist.

$ echo "(lang dune 1.11)" > dune-project
$ cat >dune <<EOF
> (dirs foo)
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/double-echo.t/run.t
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Concatenates consecutive `echo` actions in a single redirected output.

$ dune build
foobar
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Initializes a project in the current directory.

$ dune init project name $PWD
Success: initialized project component named name
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests dune memory on the full build universe.

$ env DUNE_CACHE=enabled XDG_RUNTIME_DIR=$PWD/.xdg-runtime XDG_CACHE_HOME=$PWD/.xdg-cache dune build @x
Hello, world!
$ env DUNE_CACHE=enabled XDG_RUNTIME_DIR=$PWD/.xdg-runtime XDG_CACHE_HOME=$PWD/.xdg-cache dune build @x
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Allows empty glob dependencies.

$ dune exec ./main.exe
Hello World
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/enabled_if/eif-dune-describe.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Tests enabled_if when running dune describe.

$ cat > dune <<EOF
> (executable
> (name test)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Tests enabled_if with ocaml_version_lte.

$ dune build
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/exclude-missing-module.t/run.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rejects excluding modules that do not exist.

$ dune build
File "dune", line 3, characters 22-26:
3 | (modules :standard \ fake))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Tests dune exec with a custom DUNE_BUILD_DIR.

$ DUNE_BUILD_DIR="$PWD/_custom" dune exec ./main.exe
foobar
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rejects unsupported extension versions.

$ dune build
File "dune-project", line 2, characters 14-17:
2 | (using menhir 4.0)
Expand All @@ -6,4 +8,3 @@
Supported versions of this extension in version 1.2 of the dune language:
- 1.0
[1]

Loading
Loading