Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept dune-file as dune file name #4428

Merged
merged 4 commits into from
Apr 8, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add tests
Signed-off-by: nojebar <nicolas.ojeda.bar@lexifi.com>
nojb committed Apr 8, 2021
commit 4ac9f3fc8f21b5113d69866cdc69598dc98b8ef7
43 changes: 43 additions & 0 deletions test/blackbox-tests/test-cases/alternative-dune-fname.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Check support for alternative dune file name "dune-file".

The feature is not supported in < 3.0.

$ cat >dune-project <<EOF
> (lang dune 2.8)
> (accept_alternative_dune_file_name)
> EOF
$ dune build
File "dune-project", line 2, characters 0-35:
2 | (accept_alternative_dune_file_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: 'accept_alternative_dune_file_name' is only available since version
3.0 of the dune language. Please update your dune-project file to have (lang
dune 3.0).
[1]

The feature *is* supported in 3.0 and later, but it is opt-in:

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

$ cat >dune <<EOF
> (rule (alias foo) (action (echo "In dune")))
> EOF

$ cat >dune-file <<EOF
> (rule (alias foo) (action (echo "In dune-file")))
> EOF

$ dune build @foo
In dune

Need to enable explicitly:

$ cat >dune-project <<EOF
> (lang dune 3.0)
> (accept_alternative_dune_file_name)
> EOF

$ dune build @foo
In dune-file