File: helloworld

package info (click to toggle)
ocaml-luv 0.5.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,504 kB
  • sloc: ml: 11,130; makefile: 6,223; sh: 4,592; ansic: 1,517; python: 38
file content (31 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

set -e

testdir=$(mktemp -d)
trap "rm -rf ${testdir}" 0 INT QUIT ABRT PIPE TERM
cd ${testdir}

cat <<EOF > hello_world.ml
let () =
  print_endline "Hello, world!";
  ignore (Luv.Loop.run () : bool)
EOF

cat <<EOF > dune-project
(lang dune 2.7)
EOF

cat <<EOF > dune
(executable
 (name hello_world)
 (libraries luv))
EOF

dune build

echo "build: OK"

dune exec ./hello_world.exe | grep -q "Hello, world!"

echo "run: OK"