diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-05-15 13:26:42 +1000 |
|---|---|---|
| committer | David Gibson <david@gibson.dropbear.id.au> | 2026-05-15 14:11:23 +1000 |
| commit | 1af39cf7c7bb784517f8e89409c5d7e1b1bc1505 (patch) | |
| tree | 84138d103c42fe0828ccc0454f5dc7ebf5e539bc | |
| parent | 93b6f3ef4c3349df7bb4443a389a07662fe02478 (diff) | |
| download | passt-1af39cf7c7bb784517f8e89409c5d7e1b1bc1505.tar passt-1af39cf7c7bb784517f8e89409c5d7e1b1bc1505.tar.gz passt-1af39cf7c7bb784517f8e89409c5d7e1b1bc1505.tar.bz2 passt-1af39cf7c7bb784517f8e89409c5d7e1b1bc1505.tar.lz passt-1af39cf7c7bb784517f8e89409c5d7e1b1bc1505.tar.xz passt-1af39cf7c7bb784517f8e89409c5d7e1b1bc1505.tar.zst passt-1af39cf7c7bb784517f8e89409c5d7e1b1bc1505.zip | |
test: Add test for builds with -DNDEBUGndebug
Since bc872d91765d we omit assert()s if the NDEBUG preprocessor symbol is
defined, as is the case with the standard library assert(3). However,
none of our tests verify that we can actually build that way. Add an
extra test to test/build/build.py tto verify this.
Fixes: bc872d91765d ("treewide: Spell ASSERT() as assert()")
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
| -rwxr-xr-x | test/build/build.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/build/build.py b/test/build/build.py index eeee5ac..59de014 100755 --- a/test/build/build.py +++ b/test/build/build.py @@ -78,6 +78,20 @@ exeter.register('make_all', test_make, 'all', BINARIES) @exeter.test +def test_ndebug() -> None: + """Test build with -NDEBUG + + Tests that we can build all binaries with -DNDEBUG (warnings are + expected, though). Doesn't test that they actually work. + """ + + with clone_sources(): + sh('make all CPPFLAGS="-DNDEBUG" CFLAGS="-w"') + for b in BINARIES: + assert Path(b).exists(), f"{b} wasn't made" + + +@exeter.test def test_install_uninstall() -> None: """Test `make install` and `make uninstall` |
