public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top, Stefano Brivio <sbrivio@redhat.com>
Cc: Jan Palus <jpalus@fastmail.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 3/3] test: Add test for builds with -DNDEBUG
Date: Fri, 15 May 2026 14:13:12 +1000	[thread overview]
Message-ID: <20260515041312.317644-4-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20260515041312.317644-1-david@gibson.dropbear.id.au>

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>
---
 test/build/build.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/test/build/build.py b/test/build/build.py
index eeee5acc..59de014a 100755
--- a/test/build/build.py
+++ b/test/build/build.py
@@ -77,6 +77,20 @@ for bin in BINARIES:
 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`
-- 
2.54.0


      parent reply	other threads:[~2026-05-15  8:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15  4:13 [PATCH 0/3] Fix broken build " David Gibson
2026-05-15  4:13 ` [PATCH 1/3] test: Extend exeter build tests to cover more recent binaries David Gibson
2026-05-15  4:13 ` [PATCH 2/3] Fix build with -DNDEBUG David Gibson
2026-05-15 11:05   ` Jan Palus
2026-05-16  6:28     ` David Gibson
2026-05-16  9:27       ` Stefano Brivio
2026-05-16 11:12         ` David Gibson
2026-05-15  4:13 ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260515041312.317644-4-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=jpalus@fastmail.com \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).