#!/bin/sh -ex

# Suppress deprecation warnings like in debian/rules:
./configure CXXFLAGS=-Wno-deprecated-declarations --disable-doxygen-doc

# Work around the make dependency:
touch saml/libsaml.la
# Replace the linker option:
make samltest_LDADD="$(pkg-config --libs opensaml xmltooling xml-security-c xerces-c)" \
    VERBOSE=1 \
    SAMLTEST_NETWORKED=1 \
    -C samltest check || ret=$?

if [ "$AUTOPKGTEST_ARTIFACTS" ]; then
    mv samltest/*.log samltest/*.trs "$AUTOPKGTEST_ARTIFACTS"
fi

exit $ret
