Resurrect #10241 with nits addressed
Not sure how much people want this. Would be useful for functional tests which cause bitcoind to print to stderr.
Tests which pass with non-empty stderr are reported as "passed with
warnings"
38@@ -40,17 +39,28 @@
39 CROSS = "x "
40 CIRCLE = "o "
41
42+# Default colors to empty strings.
43+BOLD, BLUE, RED, GREY, MAGENTA = [("", "")] * 5
48- BLUE = ('\033[0m', '\033[0;34m')
49- RED = ('\033[0m', '\033[0;31m')
50 GREY = ('\033[0m', '\033[1;30m')
51+ RED = ('\033[0m', '\033[0;31m')
52+ BLUE = ('\033[0m', '\033[0;34m')
53+ MAGENTA = ('\033[0m', '\033[0;35m')
57
58+STATUS_PASSED = "Passed"
59+STATUS_PASSED_WITH_WARNINGS = "Passed with warnings"
60+STATUS_SKIPPED = "Skipped"
61+STATUS_FAILED = "Failed"
62+STATUSES = [STATUS_PASSED, STATUS_PASSED_WITH_WARNINGS, STATUS_SKIPPED, STATUS_FAILED]
444- color = RED
445- glyph = CROSS
446- elif self.status == "Skipped":
447+ if self.status == STATUS_PASSED_WITH_WARNINGS:
448+ color = MAGENTA
449+ glyph = TICK
59+STATUS_PASSED_WITH_WARNINGS = "Passed with warnings"
60+STATUS_SKIPPED = "Skipped"
61+STATUS_FAILED = "Failed"
62+STATUSES = [STATUS_PASSED, STATUS_PASSED_WITH_WARNINGS, STATUS_SKIPPED, STATUS_FAILED]
63+
64+STATUS_MAX_LEN = max([len(st) for st in STATUSES])
utACK d64ac3f4aab13a1a4e8d320b52e7a2b934e011b2. Note that #10882 is currently depending on this so it needs 0.15 milestone.
The code here looks like mostly output formatting changes, not actually dealing with the issue described by the title?
“Allow tests to pass” implies output formatting has to change at least somewhat to avoid giving impression that tests failed when they actually succeeded, and these changes are a pretty straightforward way of updating the output.