Skip to content

Commit

Permalink
split test
Browse files Browse the repository at this point in the history
  • Loading branch information
emillon committed Jun 6, 2023
1 parent 0f17370 commit 92e234c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
16 changes: 1 addition & 15 deletions test/blackbox-tests/test-cases/test-build-if/feature.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ cat > dune-project << EOF
> (lang dune 3.8)
> (lang dune 3.9)
> EOF

The fields evaluates to true then var=true is passed.
Expand All @@ -15,20 +15,6 @@ The fields evaluates to true then var=true is passed.
> broken
> EOF

Version check: this only works on 3.9+.

$ dune build
File "dune", line 3, characters 1-30:
3 | (build_if %{env:BUILD=false})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: 'build_if' is only available since version 3.9 of the dune language.
Please update your dune-project file to have (lang dune 3.9).
[1]

$ cat > dune-project << EOF
> (lang dune 3.9)
> EOF

The build is attempted only when the enabled_if clause evaluates to true.

$ dune build
Expand Down
25 changes: 25 additions & 0 deletions test/blackbox-tests/test-cases/test-build-if/version.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
$ cat > dune-project << EOF
> (lang dune 3.8)
> EOF

$ cat > dune << EOF
> (test
> (name t)
> (build_if true))
> EOF

$ touch t.ml

$ dune build
File "dune", line 3, characters 1-16:
3 | (build_if true))
^^^^^^^^^^^^^^^
Error: 'build_if' is only available since version 3.9 of the dune language.
Please update your dune-project file to have (lang dune 3.9).
[1]

$ cat > dune-project << EOF
> (lang dune 3.9)
> EOF

$ dune build

0 comments on commit 92e234c

Please sign in to comment.