#!/bin/sh
set -e -u
rm -rf obj
mkdir obj
cd obj
cmake -DUNIT_TESTING=1 ..
make -C tests/
cd tests
sed -e 's#\(LD_PRELOAD=\)[^;]*/\(libpriv_wrapper.so\)#\1\2#' -i CTestTestfile.cmake
make test ARGS="--output-on-failure"
