#!/bin/sh
# Copyright 2016 Ghislain Antony Vaillant
#
# This file is part of the packaging testsuite for glbinding.

set -eux

cp -r /usr/src/googletest "$AUTOPKGTEST_TMP"
cp -r source/tests/* "$AUTOPKGTEST_TMP"
cp -r cmake "$AUTOPKGTEST_TMP"

cd "$AUTOPKGTEST_TMP"

# The RingBuffer test is excluded, since it relies on private headers.
sed -e '/RingBuffer/ s/^/#/' -i glbinding-test/CMakeLists.txt

# Configure, build, test
cmake -B _build
cmake --build _build --verbose
make -C _build test
