|
| 1 | +Test case for https://github.com/ocaml/dune/issues/3322 |
| 2 | +"dune exec needs to add .exe on Windows" |
| 3 | + |
| 4 | + $ os_type=$(ocamlc -config-var os_type) |
| 5 | + |
| 6 | +Test that on Windows `dune exec -- public_name` and |
| 7 | +`dune exec -- public_name.exe` have the same effect. |
| 8 | + |
| 9 | +With extension |
| 10 | +============== |
| 11 | + |
| 12 | + $ dune clean |
| 13 | + $ dune build @install |
| 14 | + $ if [ $os_type = Win32 ]; then dune exec -- shaihulud.exe; else echo "Hello, World!"; fi |
| 15 | + Hello, World! |
| 16 | + |
| 17 | +Without extension, prebuild |
| 18 | +================= |
| 19 | + |
| 20 | + $ dune clean |
| 21 | + $ dune build @install |
| 22 | + $ dune exec -- shaihulud |
| 23 | + Hello, World! |
| 24 | + |
| 25 | + |
| 26 | +Test that `dune exec -- public_name` (omitting the .exe) works from a |
| 27 | +clean state. |
| 28 | + |
| 29 | +Without extension, clean state |
| 30 | +============================== |
| 31 | + |
| 32 | + $ dune clean |
| 33 | + $ dune exec -- shaihulud |
| 34 | + Hello, World! |
| 35 | + |
| 36 | + |
| 37 | +Test that the public name resolves well to the actual executable file |
| 38 | +when a dependency changes. On platforms where there are no symlinks, |
| 39 | +updating the public_name executable matters. |
| 40 | + |
| 41 | +With extension, prebuild |
| 42 | +============== |
| 43 | + |
| 44 | + $ dune clean |
| 45 | + $ dune build @install |
| 46 | + |
| 47 | + $ if [ $os_type = Win32 ]; then dune exec -- shaihulud.exe; else echo "Hello, World!"; fi |
| 48 | + Hello, World! |
| 49 | + $ dune exec -- ./example.exe |
| 50 | + Hello, World! |
| 51 | + $ sed -i'' 's/World/Arrakis/' example.ml |
| 52 | + $ if [ $os_type = Win32 ]; then dune exec -- shaihulud.exe; else echo "Hello, Arrakis!"; fi |
| 53 | + Hello, Arrakis! |
| 54 | + $ dune exec -- ./example.exe |
| 55 | + Hello, Arrakis! |
| 56 | +
|
| 57 | +Without extension, prebuild |
| 58 | +================= |
| 59 | +
|
| 60 | + $ sed -i'' 's/Arrakis/World/' example.ml |
| 61 | + $ dune clean |
| 62 | + $ dune build @install |
| 63 | +
|
| 64 | + $ dune exec -- shaihulud |
| 65 | + Hello, World! |
| 66 | + $ dune exec -- ./example.exe |
| 67 | + Hello, World! |
| 68 | + $ sed -i'' 's/World/Arrakis/' example.ml |
| 69 | + $ dune exec -- shaihulud |
| 70 | + Hello, Arrakis! |
| 71 | + $ dune exec -- ./example.exe |
| 72 | + Hello, Arrakis! |
| 73 | +
|
| 74 | +Without extention, clean state |
| 75 | +============================== |
| 76 | +
|
| 77 | + $ sed -i'' 's/Arrakis/World/' example.ml |
| 78 | + $ dune clean |
| 79 | +
|
| 80 | + $ dune exec -- shaihulud |
| 81 | + Hello, World! |
| 82 | + $ dune exec -- ./example.exe |
| 83 | + Hello, World! |
| 84 | + $ sed -i'' 's/World/Arrakis/' example.ml |
| 85 | + $ dune exec -- shaihulud |
| 86 | + Hello, Arrakis! |
| 87 | + $ dune exec -- ./example.exe |
| 88 | + Hello, Arrakis! |
0 commit comments