| 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | testdir=$(mktemp -d) |
| 6 | trap "rm -rf ${testdir}" 0 INT QUIT ABRT PIPE TERM |
| 7 | cd ${testdir} |
| 8 | |
| 9 | cat <<EOF > hello_world.ml |
| 10 | let () = |
| 11 | print_endline "Hello, world!"; |
| 12 | ignore (Luv.Loop.run () : bool) |
| 13 | EOF |
| 14 | |
| 15 | cat <<EOF > dune-project |
| 16 | (lang dune 2.7) |
| 17 | EOF |
| 18 | |
| 19 | cat <<EOF > dune |
| 20 | (executable |
| 21 | (name hello_world) |
| 22 | (libraries luv)) |
| 23 | EOF |
| 24 | |
| 25 | dune build |
| 26 | |
| 27 | echo "build: OK" |
| 28 | |
| 29 | dune exec ./hello_world.exe | grep -q "Hello, world!" |
| 30 | |
| 31 | echo "run: OK" |