Andrew Jeffery | 1b1b728 | 2024-06-04 00:14:46 +0930 | [diff] [blame] | 1 | #!/usr/bin/sh |
| 2 | set -eu |
| 3 | |
| 4 | BUILD="$(mktemp --directory --tmpdir=.)" |
| 5 | trap 'rm -rf "$BUILD"' EXIT |
| 6 | |
Andrew Jeffery | e984a46 | 2024-09-07 11:23:28 +0200 | [diff] [blame] | 7 | meson format --recursive --inplace || true |
| 8 | git diff --quiet |
| 9 | |
Andrew Jeffery | 1b1b728 | 2024-06-04 00:14:46 +0930 | [diff] [blame] | 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. |
| 13 | meson setup -Dabi-compliance-check=disabled "$BUILD" |
| 14 | meson compile -C "$BUILD" |
| 15 | meson 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. |
| 22 | meson configure --buildtype=release "$BUILD" |
| 23 | meson compile -C "$BUILD" |
Andrew Jeffery | 0129c53 | 2024-09-07 11:33:25 +0200 | [diff] [blame] | 24 | meson test -C "$BUILD" --timeout-multiplier 10 --wrapper 'valgrind --error-exitcode=1' |
Andrew Jeffery | 1b1b728 | 2024-06-04 00:14:46 +0930 | [diff] [blame] | 25 | |
| 26 | # Ensure the test suite links when testing symbols are removed from the ABI |
| 27 | meson configure --buildtype=debug "$BUILD" |
| 28 | meson configure -Dabi=deprecated,stable "$BUILD" |
| 29 | meson compile -C "$BUILD" |
| 30 | meson test -C "$BUILD" |