debian/tests/neko-test
raw| 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' > test.neko |
| 10 | $print("The virtual machine is working !\n"); |
| 11 | test = $loader.loadprim("std@test",0); |
| 12 | test(); |
| 13 | $print("Test successful\n"); |
| 14 | EOF |
| 15 | |
| 16 | nekoc test.neko |
| 17 | |
| 18 | echo "compile: OK" |
| 19 | |
| 20 | neko test.n | grep -q "Test successful" |
| 21 | |
| 22 | echo "run: OK" |