@@ -6,54 +6,52 @@ Here we test the features of the `dune runtest` command.
66
77 $ cat > mytest. t << EOF
88 > $ echo " Hello, world!"
9- > " Goodbye, world!"
9+ > " Goodbye, world!"
1010 > EOF
1111 $ mkdir -p tests/ myothertest. t
1212 $ echo ' Hello, world!' > tests/ myothertest. t/ hello. world
1313 $ cat > tests/ myothertest. t/ run . t << EOF
1414 > $ cat hello. world
15- > " Goodbye, world!"
15+ > " Goodbye, world!"
1616 > EOF
1717 $ cat > tests/ filetest. t << EOF
1818 > $ echo " Hello, world!"
19- > " Goodbye, world!"
19+ > " Goodbye, world!"
2020 > EOF
2121
22-
23- This should work:
22+ dune runtest should be able to run a specfic test. In this case,
23+ tests/ myothertest. t should fail because the expected output is different from
24+ the observed output.
2425
2526 $ dune test tests/ myothertest. t
2627 File " tests/myothertest.t/run.t" , line 1 , characters 0 -0:
2728 Error: Files _build/ default / tests/ myothertest. t/ run . t and
2829 _build/ default / tests/ myothertest. t/ run . t. corrected differ.
2930 [1 ]
30-
31- There is no diff produced because the test passes
32-
3331 $ dune promotion diff tests/ myothertest. t/ run . t
3432
35- This should not work
36-
37- $ dune test myotherttest. t
38- Error: " myotherttest.t" does not match any known test.
39- [1 ]
33+ We use the promotion diff command to check there is a promotion pending. If
34+ there is no promotion it will warn .
4035
41- This is a bug . Running the test this way does not correctly include the
42- dependencies .
36+ If the user writes the run . t file of a directory test, we should correct it to
37+ be the corresponding directory cram test .
4338
4439 $ dune test tests/ myothertest. t/ run . t
4540 File " tests/myothertest.t/run.t" , line 1 , characters 0 -0:
4641 Error: Files _build/ default / tests/ myothertest. t/ run . t and
4742 _build/ default / tests/ myothertest. t/ run . t. corrected differ.
4843 [1 ]
49-
5044 $ dune promotion diff tests/ myothertest. t/ run . t
5145
52- $ cat _build/. promotion-staging/ tests/ myothertest. t/ run . t
53- $ cat hello. world
54- cat : hello. world: No such file or directory
55- [1 ]
56- " Goodbye, world!"
46+ We cannot give the name of a cram test in a subdirectory and expect Dune to
47+ find it.
48+
49+ $ dune test myothertest. t
50+ Error: " myothertest.t" does not match any known test.
51+ [1 ]
52+
53+ $ dune promotion diff tests/ myothertest. t/ run . t
54+ Warning: Nothing to promote for tests/ myothertest. t/ run . t.
5755
5856Passing no arguments to $ dune runtest should be equivalent to $ dune build
5957@ runtest .
@@ -161,7 +159,7 @@ the directory is mispelled.
161159 Error: This path is outside the workspace: / a/ b/ c/
162160 [1 ]
163161
164- Here we test behavour for running tests in specific contexts.
162+ Here we test behaviour for running tests in specific contexts.
165163
166164 $ cat > dune-workspace << EOF
167165 > (lang dune 3.20 )
0 commit comments