Files
gentoo-utils/check.sh
2025-11-22 05:52:53 +00:00

29 lines
648 B
Bash
Executable File

#!/bin/bash
source /etc/profile
export PATH="${HOME}/.local/bin:${PATH}" CC=clang CXX=clang++
if command -v ldd; then
export LDFLAGS=-fuse-ld=lld
fi
for file in $(find src -type f -name '*.rs'); do
rustfmt --edition 2024 --check ${file} || exit $?
done
if [[ ! -d build ]]; then
meson setup -Dfuzz=enabled -Dtests=enabled build || exit $?
fi
meson compile -C build || exit $?
ninja clippy -C build || exit $?
for test in unittests; do
meson test -v ${test} -C build || exit $?
done
# hack to make sure we use the system meson, since meson format from git is broken
/usr/bin/meson format --recursive --check-only || exit $?