Skip to content

Commit

Permalink
add reproduction test for #10236 (#10241)
Browse files Browse the repository at this point in the history
Signed-off-by: Corentin Leruth <[email protected]>
  • Loading branch information
tatchi authored Mar 14, 2024
1 parent a262a63 commit e45ac2f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/exec-watch/exec-pwd.t/bin/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(executable
(name main))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.6)
25 changes: 25 additions & 0 deletions test/blackbox-tests/test-cases/exec-watch/exec-pwd.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
$ export OUTPUT=output.txt

In normal (non-watching) mode, pwd is the folder from which dune is launched
$ cd bin
$ dune exec --root .. -- pwd > $OUTPUT
Entering directory '..'
Leaving directory '..'
$ cat $OUTPUT
$TESTCASE_ROOT/bin
$ rm -rf $OUTPUT
$ cd ..

While in watch mode, pwd is always the root project folder
$ cd bin
$ dune exec --root .. -w -- pwd > $OUTPUT &
Entering directory '..'
Success, waiting for filesystem changes...
Leaving directory '..'
$ PID=$!
$ until test -s $OUTPUT; do sleep 0.1; done;
$ kill $PID
$ cat $OUTPUT
$TESTCASE_ROOT
$ rm -rf $OUTPUT
$ cd ..

0 comments on commit e45ac2f

Please sign in to comment.