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
|
#!/bin/sh
set -e
testdir=$(mktemp -d)
trap "rm -rf ${testdir}" 0 INT QUIT ABRT PIPE TERM
cd ${testdir}
cat <<EOF > test.ml
open ExtString
module S = String
let _ = assert (S.starts_with "foo" ~prefix:"f")
EOF
if [ -x '/usr/bin/ocamlopt' ]
then
ocamlfind ocamlopt -o native-code-test -package extlib -linkpkg test.ml
echo "build: OK"
[ -x native-code-test ]
./native-code-test
echo "run: OK"
else
echo "skip native-code test since ocamlopt is not available"
fi
|