#!/bin/bash
set -e
set -o pipefail

# Wrapper to run the tests in gitlab CI

x () { echo >&2 "+ $*"; "$@"; }

deps=$(tests/enumerate-tests dep-packages)
ours=$(perl -ne 'print if s{^package:\s*(\S+)\s*$}{$1\n}i' <debian/control)

x apt-get -y install --no-install-recommends $deps
x apt-get -y build-dep .
x apt-get -y remove $ours

x tests/using-intree tests/run-all
