forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Corentin Leruth <[email protected]>
- Loading branch information
Showing
6 changed files
with
43 additions
and
3 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
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
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/exec-watch/exec-watch-multi-levels.t/bin/dune
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 @@ | ||
(executable | ||
(name main) | ||
(libraries unix)) |
9 changes: 9 additions & 0 deletions
9
test/blackbox-tests/test-cases/exec-watch/exec-watch-multi-levels.t/bin/main.ml
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,9 @@ | ||
let () = | ||
let touch path = | ||
let fd = Unix.openfile path [ Unix.O_CREAT ] 777 in | ||
Unix.close fd | ||
in | ||
print_endline "foo"; | ||
match Sys.argv.(1) with | ||
| exception _ -> () | ||
| path -> touch path |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/exec-watch/exec-watch-multi-levels.t/dune-project
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 @@ | ||
(lang dune 3.6) |
27 changes: 27 additions & 0 deletions
27
test/blackbox-tests/test-cases/exec-watch/exec-watch-multi-levels.t/run.t
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,27 @@ | ||
|
||
exec + watch works fine when invoked at the root level | ||
$ DONE_FLAG=_build/done_flag | ||
$ dune exec --watch ./bin/main.exe $DONE_FLAG & | ||
Success, waiting for filesystem changes... | ||
foo | ||
$ PID=$! | ||
|
||
Wait for the $DONE_FLAG file to exist, then delete the file. This file is | ||
created by the program being exec'd, so when it exists we know that it's safe to | ||
change the code and proceed with the test. | ||
$ ../wait-for-file.sh $DONE_FLAG | ||
$ kill $PID | ||
|
||
|
||
It's broken when invoked in a child folder | ||
$ cd bin && dune exec --root .. --watch ./bin/main.exe & | ||
Entering directory '..' | ||
Error: posix_spawn(): No such file or directory | ||
Leaving directory '..' | ||
$ wait | ||
|
||
But it works fine without watch mode | ||
$ cd bin && dune exec --root .. ./bin/main.exe | ||
Entering directory '..' | ||
Leaving directory '..' | ||
foo |