1#!/usr/bin/sh
2set -eu
3
4BUILD="$(mktemp --directory --tmpdir=.)"
5trap 'rm -rf "$BUILD"' EXIT
6
7meson format --recursive --inplace || true
8git diff --quiet
9
10# Ensure the test suite passes in the default configuration. Note
11# that we don't specify -Dabi=... - the default is equivalent to
12# -Dabi=deprecated,stable,testing.
13CFLAGS=-fanalyzer meson setup -Dabi-compliance-check=disabled "$BUILD"
14meson compile -C "$BUILD"
15meson test -C "$BUILD"
16
17# Ensure the test suite passes in release mode. libpldm specifies
18# -Db_ndebug=if-release by default, so building with --buildtype=release passes
19# -DNDEBUG to the compiler for the library implementation. This build
20# configuration will catch any unexpected changes in the library implementation
21# and incorrect test case implementations.
22meson configure --buildtype=release "$BUILD"
23meson compile -C "$BUILD"
24meson test -C "$BUILD" --timeout-multiplier 10 --wrapper 'valgrind --error-exitcode=1'
25
26# Ensure the test suite links when testing symbols are removed from the ABI
27meson configure --buildtype=debug "$BUILD"
28meson configure -Dabi=deprecated,stable "$BUILD"
29meson compile -C "$BUILD"
30meson test -C "$BUILD"
31