-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: specify intended features of dune runtest
Signed-off-by: Ali Caglayan <alizter@gmail.com>
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 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,48 @@ | ||
Here we test the features of the `dune runtest` command. | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.16) | ||
> EOF | ||
|
||
$ cat > mytest.t <<EOF | ||
> $ echo "Hello, world!" | ||
> "Goodbye, world!" | ||
> EOF | ||
$ mkdir -p tests/myothertest.t | ||
$ cat > tests/myothertest.t/run.t <<EOF | ||
> $ echo "Hello, world!" | ||
> "Goodbye, world!" | ||
> EOF | ||
|
||
Passing no arguments to `dune runtest` should be equivalent to `dune build | ||
@runtest`. | ||
|
||
$ dune test 2>&1 | grep "^File" | ||
File "mytest.t", line 1, characters 0-0: | ||
File "tests/myothertest.t/run.t", line 1, characters 0-0: | ||
|
||
Passing the name of a test should only run that test. | ||
Currently, this is not the case. | ||
|
||
$ dune test mytest | ||
Error: Don't know about directory mytest specified on the command line! | ||
[1] | ||
$ dune test mytest.t | ||
Error: Don't know about directory mytest.t specified on the command line! | ||
[1] | ||
$ dune test tests/myothertest | ||
Error: Don't know about directory tests/myothertest specified on the command | ||
line! | ||
[1] | ||
$ dune test tests/myothertest.t | ||
|
||
Passing a directory should run all the tests in that directory (recursively). | ||
|
||
The current working directory: | ||
$ dune test . 2>&1 | grep "^File" | ||
File "mytest.t", line 1, characters 0-0: | ||
File "tests/myothertest.t/run.t", line 1, characters 0-0: | ||
|
||
The tests/ subdirectory: | ||
$ dune test tests/ 2>&1 | grep "^File" | ||
File "tests/myothertest.t/run.t", line 1, characters 0-0: |