#!/bin/bash

if [ -z "${MESON_BUILD_ROOT}" ]; then
  echo "[ERROR] This script can only be ran with meson!"
  exit 1
fi

set -euo pipefail

cd "${MESON_BUILD_ROOT}"

ninja clang-format wrap clang-tidy
ninja test
ninja code-coverage
ninja sanitize-undefined
cd "${MESON_SOURCE_ROOT}"
./compile
cd "${MESON_SOURCE_ROOT}/build"
ninja test-wrappers
