#!/bin/bash
set -evux

check_command()
{
	# Set LD_LIBRARY_PATH so tests can find the installed libs
	LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/taler:/usr/lib:/usr/lib/taler PGPORT=5432 make check
}

print_logs()
{
  set +e
	echo "Printing meson log"
  cat build/meson-logs/testlog.txt
}

if ! check_command ; then
	print_logs
	exit 1
fi
