#!/bin/sh

set -eu

# exit code is useless, we need to parse for "not ok"
OUT=$(LC_ALL=C pg_virtualenv perl test.pl 2>&1) || EXIT=1
echo "$OUT"

[ "${EXIT:-}" ] && exit 1

if echo "$OUT" | grep -q 'not ok'; then
    echo "FAILED" >&2
    exit 1
fi
