#!/bin/bash
set -e

cp -r test cmake "$AUTOPKGTEST_TMP"
cat > "$AUTOPKGTEST_TMP/CMakeLists.txt" << EOF
cmake_minimum_required(VERSION 3.20)
project(fastcdr_autopkgtest)
find_package(fastcdr REQUIRED)
include(cmake/common/check_configuration.cmake)
include(CTest)
add_subdirectory(test)
EOF
cd "$AUTOPKGTEST_TMP"
mkdir _build
cd _build
cmake .. -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build . --verbose -j$(nproc)
ctest --output-on-failure -E force_standard

