aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2026-05-15 14:13:12 +1000
committerStefano Brivio <sbrivio@redhat.com>2026-05-16 17:05:56 +0200
commit8bb21e3209d978b5337d4f21fd0d018e8012f059 (patch)
tree3ab00bb45f0d6f7e2bc77db25eb06c9063f54974
parente51494552b784861b58f9546a25dfd74b8c09de9 (diff)
downloadpasst-8bb21e3209d978b5337d4f21fd0d018e8012f059.tar
passt-8bb21e3209d978b5337d4f21fd0d018e8012f059.tar.gz
passt-8bb21e3209d978b5337d4f21fd0d018e8012f059.tar.bz2
passt-8bb21e3209d978b5337d4f21fd0d018e8012f059.tar.lz
passt-8bb21e3209d978b5337d4f21fd0d018e8012f059.tar.xz
passt-8bb21e3209d978b5337d4f21fd0d018e8012f059.tar.zst
passt-8bb21e3209d978b5337d4f21fd0d018e8012f059.zip
test: Add test for builds with -DNDEBUG
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> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rwxr-xr-xtest/build/build.py14
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`