forked from gentoo-utils/gentoo-utils
port check.sh to use only meson
This commit is contained in:
28
check.sh
28
check.sh
@@ -2,25 +2,27 @@
|
|||||||
|
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
|
|
||||||
export CC=clang CXX=clang++
|
export PATH="${HOME}/.local/bin:${PATH}" CC=clang CXX=clang++
|
||||||
|
|
||||||
cargo fmt --check || exit $?
|
if command -v ldd; then
|
||||||
|
export LDFLAGS=-fuse-ld=lld
|
||||||
|
fi
|
||||||
|
|
||||||
cargo clippy || exit $?
|
for file in $(find src -type f -name '*.rs'); do
|
||||||
|
rustfmt --edition 2024 --check ${file} || exit $?
|
||||||
|
done
|
||||||
|
|
||||||
cargo test -r || exit $?
|
if [[ ! -d build ]]; then
|
||||||
|
meson setup -Dtests=enabled build || exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
cargo build --all --all-features || exit $?
|
meson compile -C build || exit $?
|
||||||
|
|
||||||
build=$(mktemp -d)
|
ninja clippy -C build || exit $?
|
||||||
|
|
||||||
meson setup ${build} || exit $?
|
for test in unittests; do
|
||||||
|
meson test -v ${test} -C build || exit $?
|
||||||
meson compile -C ${build} || exit $?
|
done
|
||||||
|
|
||||||
meson test -C ${build} || exit $?
|
|
||||||
|
|
||||||
rm -rf ${build}
|
|
||||||
|
|
||||||
# hack to make sure we use the system meson, since meson format from git is broken
|
# hack to make sure we use the system meson, since meson format from git is broken
|
||||||
/usr/bin/meson format --recursive --check-only || exit $?
|
/usr/bin/meson format --recursive --check-only || exit $?
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ gentoo_utils = static_library(
|
|||||||
link_with: [thiserror],
|
link_with: [thiserror],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if get_option('test').enabled()
|
||||||
|
rust.test('unittests', gentoo_utils)
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('fuzz').enabled()
|
if get_option('fuzz').enabled()
|
||||||
subdir('fuzz')
|
subdir('fuzz')
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
option('fuzz', type: 'feature', value: 'disabled')
|
option('fuzz', type: 'feature', value: 'disabled')
|
||||||
|
option('test', type: 'feature', value: 'disabled')
|
||||||
Reference in New Issue
Block a user