#!/usr/bin/env bash
# run CI-like set of tests
set -eu

dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$dir"

echo "==> test"
cargo test
cargo test --benches
echo "==> no_std"
cargo build -p ab_glyph_rasterizer --target thumbv6m-none-eabi --no-default-features --features libm
cargo build -p ab_glyph --target thumbv6m-none-eabi --no-default-features --features libm
echo "==> no_std (variable-fonts)"
cargo build -p ab_glyph --target thumbv6m-none-eabi --no-default-features --features "libm variable-fonts"
echo "==> check wasm32"
cargo build -p ab_glyph_rasterizer --target wasm32-unknown-unknown
cargo build -p ab_glyph --target wasm32-unknown-unknown
echo "==> rustfmt"
cargo fmt -- --check
