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 32 33 34 35 36 37
|
#!/bin/sh
set -e
testdir=$(mktemp -d)
trap "rm -rf ${testdir}" 0 INT QUIT ABRT PIPE TERM
cd ${testdir}
cat <<EOF > test.ml
print_string "Hello world!\n";;
EOF
cat <<EOF > test.obuild
name: test_project
version: 0.0.1
description:
This is my test project
.
This is a long description describing properly what the project does.
licence: MIT
authors: Andy Li <andy@onthewings.net>
obuild-ver: 1
homepage: https://blog.onthewings.net/
executable test
main-is: test.ml
EOF
obuild configure --disable-executable-native --enable-executable-bytecode
obuild build
echo "build: OK"
[ -x test.byte ]
./test.byte 2> /dev/null | grep -q "Hello world!"
echo "run: OK"
|