#!/bin/sh

set -e
exec 2>&1
set -x

cp tests/*.c "$ADTTMP"

cd "$ADTTMP"

NULL=
tests="
    localalloc
    shutil
    "

for t in $tests; do
    gcc -o $t $t.c $(pkg-config --cflags --libs libgsystem glib-2.0)
    test -x $t
done

cat > wrapper <<'EOF'
#!/bin/sh
exec "./$1" --tap
EOF
chmod +x wrapper
prove -e./wrapper $tests
