[Git][NTPsec/ntpsec][master] test: Success to get LOG banner, not red ERROR...
Hal Murray (@hal.murray)
gitlab at mg.gitlab.com
Fri Feb 7 07:35:07 UTC 2025
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
0079bda4 by James Browning at 2025-02-07T07:31:54+00:00
test: Success to get LOG banner, not red ERROR...
This stops trampling the principle of least astonishment.
We now print green LOG banners on success and red ERROR
banners when failing. The stderr, stdout banners only
print when that specific pipe returned data.
- - - - -
1 changed file:
- wafhelpers/test.py
Changes:
=====================================
wafhelpers/test.py
=====================================
@@ -20,10 +20,12 @@ def test_write_log(ctx):
for binary, retval, lines, error in ctx.utest_results:
fp.write("BINARY : %s\n" % binary)
fp.write("RETURN VALUE: %s\n" % retval)
- fp.write("\n*** stdout ***\n")
- fp.write(polystr(lines))
- fp.write("\n*** stderr ***\n")
- fp.write(polystr(error))
+ if lines:
+ fp.write("\n*** stdout ***\n")
+ fp.write(polystr(lines))
+ if error:
+ fp.write("\n*** stderr ***\n")
+ fp.write(polystr(error))
fp.write("\n\n\n")
pprint("BLUE", "Wrote test log to: ", file_out)
@@ -35,15 +37,17 @@ def test_print_log(ctx):
pprint("YELLOW", "RETURN VALUE:", retval)
print("")
- if retval or error:
+ if retval:
pprint("RED", "****** ERROR ******\n")
+ else:
+ pprint("GREEN", "****** LOG ******\n")
+ if lines:
print("\n*** stdout ***\n")
print(polystr(lines))
+
+ if error:
print("\n*** stderr ***\n")
print(polystr(error))
- if (not retval) and (not error):
- pprint("GREEN", "****** LOG ******\n", polystr(lines))
-
print("")
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/0079bda44de9293ca7217646404ad69fa7756a16
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/0079bda44de9293ca7217646404ad69fa7756a16
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/20250207/45c176f2/attachment-0001.htm>
More information about the vc
mailing list