blob: 0c00ac5c7cb8174a171ee1860aa4142cc01c3bc9 [file] [log] [blame]
Andrew Jeffery1b1b7282024-06-04 00:14:46 +09301#!/usr/bin/sh
2set -eu
3
4BUILD="$(mktemp --directory --tmpdir=.)"
5trap 'rm -rf "$BUILD"' EXIT
6
Andrew Jefferye984a462024-09-07 11:23:28 +02007meson format --recursive --inplace || true
8git diff --quiet
9
Andrew Jeffery1b1b7282024-06-04 00:14:46 +093010# 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.
Andrew Jefferydbbe8602024-09-23 20:15:35 +093013CFLAGS=-fanalyzer meson setup -Dabi-compliance-check=disabled "$BUILD"
Andrew Jeffery1b1b7282024-06-04 00:14:46 +093014meson 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"
Andrew Jeffery0129c532024-09-07 11:33:25 +020024meson test -C "$BUILD" --timeout-multiplier 10 --wrapper 'valgrind --error-exitcode=1'
Andrew Jeffery1b1b7282024-06-04 00:14:46 +093025
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"