blob: 8d503410cc2345425521059330ee0e35c8d2d167 [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 Jeffery5a034732024-11-22 13:49:47 +103010# Make sure if the change touches the public headers, it also updates the
11# changelog.
12if ! git show --format="" --name-only HEAD -- CHANGELOG.md include/libpldm |
13 awk -f scripts/changelog.awk
14then
15 echo You must document your changes under include/libpldm in CHANGELOG.md
16 exit 1
17fi
18
Andrew Jeffery1b1b7282024-06-04 00:14:46 +093019# Ensure the test suite passes in the default configuration. Note
20# that we don't specify -Dabi=... - the default is equivalent to
21# -Dabi=deprecated,stable,testing.
Andrew Jefferydbbe8602024-09-23 20:15:35 +093022CFLAGS=-fanalyzer meson setup -Dabi-compliance-check=disabled "$BUILD"
Andrew Jeffery1b1b7282024-06-04 00:14:46 +093023meson compile -C "$BUILD"
24meson test -C "$BUILD"
25
26# Ensure the test suite passes in release mode. libpldm specifies
27# -Db_ndebug=if-release by default, so building with --buildtype=release passes
28# -DNDEBUG to the compiler for the library implementation. This build
29# configuration will catch any unexpected changes in the library implementation
30# and incorrect test case implementations.
31meson configure --buildtype=release "$BUILD"
32meson compile -C "$BUILD"
Andrew Jeffery0129c532024-09-07 11:33:25 +020033meson test -C "$BUILD" --timeout-multiplier 10 --wrapper 'valgrind --error-exitcode=1'
Andrew Jeffery1b1b7282024-06-04 00:14:46 +093034
35# Ensure the test suite links when testing symbols are removed from the ABI
36meson configure --buildtype=debug "$BUILD"
37meson configure -Dabi=deprecated,stable "$BUILD"
38meson compile -C "$BUILD"
39meson test -C "$BUILD"