#!/bin/bash

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

set -e

cd "${MESON_BUILD_ROOT}"

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