-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix error messages when referring to the dune config (#10923)
Signed-off-by: teague hansen <[email protected]> Signed-off-by: Marek Kubica <[email protected]> Signed-off-by: Sylvain78 <[email protected]>
- Loading branch information
Showing
7 changed files
with
98 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- Fix the file referred to in the error/warning message displayed due to the | ||
dune configuration version not supporting a particular configuration | ||
stanza in use. (#10923, @H-ANSEN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Tests verifying that the config file presents accurate error or warning | ||
messages when a stanza is used with a version of dune which does not support | ||
such a stanza. | ||
|
||
Create a config file to use in the following tests. We will initialize the | ||
config with a version and a stanza incompatable with that version. | ||
|
||
$ export DUNE_CACHE_ROOT=$PWD/dune-cache | ||
$ touch dune-config | ||
$ cat >dune-config <<EOF | ||
> (lang dune 1.0) | ||
> (cache enabled) | ||
> EOF | ||
|
||
Attempt to initialize a new project while an invaild stanza due to versioning | ||
exists in the config. | ||
|
||
$ dune init proj test --config-file=dune-config | ||
File "$TESTCASE_ROOT/dune-config", line 2, characters 0-15: | ||
2 | (cache enabled) | ||
^^^^^^^^^^^^^^^ | ||
Error: 'cache' is only available since version 2.0 of the dune language. | ||
Please update your dune config file to have (lang dune 2.0). | ||
[1] | ||
|
||
Update the dune configuration with a version that would support the | ||
'(cache enabled)' stanza and attempt a successful project initialization. | ||
|
||
$ cat >dune-config <<EOF | ||
> (lang dune 2.0) | ||
> (cache enabled) | ||
> EOF | ||
|
||
$ dune init proj test_vaild --config-file=dune-config | ||
Entering directory 'test_vaild' | ||
Success: initialized project component named test_vaild | ||
Leaving directory 'test_vaild' | ||
|
||
Append an invaild stanza to the config file and attempt project initialzation. | ||
|
||
$ echo "(cache-check-probability 0.5)" >> dune-config | ||
$ dune init proj test --config-file=dune-config | ||
File "$TESTCASE_ROOT/dune-config", line 3, characters 0-29: | ||
3 | (cache-check-probability 0.5) | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Error: 'cache-check-probability' is only available since version 2.7 of the | ||
dune language. Please update your dune config file to have (lang dune 2.7). | ||
[1] | ||
|