#!/usr/bin/env bash
# Copyright 2025 GNOME Foundation, Inc.
# SPDX-License-Identifier: LGPL-2.1-or-later

set -eu

top_builddir="${G_TEST_BUILDDIR}/.."

echo "TAP version 13"
echo "1..1"
if output=$(meson compile -C "${top_builddir}" malcontent-pot 2>&1); then
    if [[ "${output}" == *"warning:"* ]]; then
        echo "not ok 1 - \`meson compile malcontent-pot\` outputted a warning"
        echo "${output}" >&2
        exit 1
    else
        echo "ok 1"
        exit 0
    fi
else
    echo "not ok 1 - \`meson compile malcontent-pot\` failed with an error"
    echo "${output}" >&2
    exit 1
fi