[Git][NTPsec/ntpsec][master] bin_test: count skips, not fail for them; verbosify

Hal Murray (@hal.murray) gitlab at mg.gitlab.com
Tue Feb 4 21:12:31 UTC 2025



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
67703f42 by James Browning at 2025-02-04T12:18:03-08:00
bin_test: count skips, not fail for them; verbosify

Start reporting skip count and rephrase fail count report.

- - - - -


1 changed file:

- wafhelpers/bin_test.py


Changes:

=====================================
wafhelpers/bin_test.py
=====================================
@@ -25,7 +25,7 @@ def addLog(color, text):
     test_logs.append((color, text))
 
 
-def bin_test_summary(ctx):
+def bin_test_summary(_ctx):
     """Print out the log."""
     for i in test_logs:
         waflib.Logs.pprint(i[0], i[1])
@@ -33,7 +33,6 @@ def bin_test_summary(ctx):
 
 def run(cmd, expected, python=None):
     """Run an individual test."""
-
     prefix = "running: " + " ".join(cmd)
 
     if not os.path.exists(cmd[0]):
@@ -81,6 +80,7 @@ def cmd_bin_test(ctx):
     """Run a suite of binary tests."""
     BIN = ctx.env.BINDIR
     SBIN = ctx.env.SBINDIR
+    skips = 0
     fails = 0
 
     cmd_list = [
@@ -122,12 +122,22 @@ def cmd_bin_test(ctx):
         INSTALL = True
 
     for cmd in etl_cases(INSTALL, version, cmd_list):
-        if not run(cmd[0], cmd[1]):
+        ret = run(cmd[0], cmd[1])
+        if ret is True:
+            pass
+        elif ret is None:
+            skips += 1
+        elif ret is False:
             fails += 1
 
+    if 1 == skips:
+        waflib.Logs.pprint("YELLOW", "Skipped one binary test.")
+    elif 1 < skips:
+        waflib.Logs.pprint("YELLOW", "Skipped %d binary tests." % skips)
+
     if 1 == fails:
         bin_test_summary(ctx)
-        ctx.fatal("1 binary test failed!")
+        ctx.fatal("Failed one binary test!")
     elif 1 < fails:
         bin_test_summary(ctx)
-        ctx.fatal("%d binary tests failed!" % fails)
+        ctx.fatal("Failed %d binary tests!" % fails)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/67703f426349af50363b3e43fc6adad84c151fe0

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/67703f426349af50363b3e43fc6adad84c151fe0
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20250204/f092cffb/attachment-0001.htm>


More information about the vc mailing list