-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(cram): allow overriding default alias (#8887)
Introduce a [(runtest_alias ..)] that allows to enable/disable the runtest alias for cram tests. Unlike, the existing [alias] field, we're only allowed to set the this value once. Signed-off-by: Rudi Grinberg <[email protected]>
- Loading branch information
Showing
6 changed files
with
147 additions
and
46 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,2 @@ | ||
- Introduce the `runtest_alias` field to the `cram` stanza. This allows | ||
removing default `runtest` alias from tests. (@rgrinberg, #8887) |
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,44 @@ | ||
Control the default runtest alias for cram tests | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.11) | ||
> EOF | ||
|
||
$ cat >dune <<EOF | ||
> (cram | ||
> (runtest_alias false) | ||
> (alias this)) | ||
> EOF | ||
|
||
$ cat >foo.t <<EOF | ||
> $ echo foo | ||
> EOF | ||
|
||
This shouldn't run the test | ||
|
||
$ dune runtest | ||
|
||
This should run the test | ||
|
||
$ dune build @this | ||
File "foo.t", line 1, characters 0-0: | ||
Error: Files _build/default/foo.t and _build/default/foo.t.corrected differ. | ||
[1] | ||
|
||
Now we try setting runtest alias default twice. This should be impossible: | ||
|
||
$ cat >dune <<EOF | ||
> (cram (runtest_alias false)) | ||
> (cram (runtest_alias true)) | ||
> EOF | ||
|
||
$ dune build @a | ||
File "dune", line 2, characters 21-25: | ||
2 | (cram (runtest_alias true)) | ||
^^^^ | ||
Error: enabling or disabling the runtest alias for a cram test may only be | ||
set once. | ||
It's already set for the test "foo" | ||
The first definition is at: | ||
dune:1 | ||
[1] |