#!/bin/sh

set -e

case $USER in
	root) PGUSER=postgres ;;
	*)    PGUSER=$USER ;;
esac

for v in $(pg_buildext supported-versions); do
	if [ "$v" = "9.4" ]; then continue; fi
	export PATH=/usr/lib/postgresql/$v/bin/:$PATH
	pg_prove -I /usr/lib/postgresql/$v/lib/pgxs/src/makefiles/../../src/test/perl/ -ovf t/010_pglogical_create_subscriber.pl
	pg_prove -I /usr/lib/postgresql/$v/lib/pgxs/src/makefiles/../../src/test/perl/ -ovf t/020_non_default_replication_set.pl
done
