#!/bin/sh

set -ev

SRCDIR="$(pwd)"

cd "$AUTOPKGTEST_TMP"

cmake -DCMake_TEST_EXTERNAL_CMAKE=/usr/bin "$SRCDIR"
make VERBOSE=1
# The tests ExternalProject and Ctest.UpdateGIT are excluded because they try to git clone submodules
# using "file://" which is in some way restricted by the fix of CVE-2022-39253 in git
CTEST_OUTPUT_ON_FAILURE=1 ctest -E '(CTestTestUpload|BootstrapTest|ExternalProject|CTest.UpdateGIT)'
