#!/bin/sh

set -e

target=$(mktemp)

echo "Compile and capture output of LilvWorldTest.c"
if gcc debian/tests/LilvWorldTest.c -I/usr/include/lilv-0 $(pkgconf −−cflags lilv−0) $(pkgconf --libs lilv-0) -o "$target" 2>&1; then
  echo "Compilation: OK — binary written to $target"
  echo "Binary size: $(stat -c%s "$target") bytes"
else
  echo "Compilation: FAILED"
  exit 1
fi

echo "Run binary"
if "$target"; then
  echo "Run: OK"
else
  echo "Run: FAILED"
  exit 1
fi

exit 0
