You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests: Use colors and dots in test_runner.py output only if standard output is a terminal -- allows for using the test runner output as input to other programs
Copy file name to clipboardexpand all lines: test/functional/test_runner.py
+18-5
Original file line number
Diff line number
Diff line change
@@ -227,6 +227,7 @@ def main():
227
227
epilog='''
228
228
Help text and arguments for individual test script:''',
229
229
formatter_class=argparse.RawTextHelpFormatter)
230
+
parser.add_argument('--ansi', action='store_true', default=sys.stdout.isatty(), help="Use ANSI colors and dots in output (enabled by default when standard output is a TTY)")
230
231
parser.add_argument('--combinedlogslen', '-c', type=int, default=0, metavar='n', help='On failure, print a log (of length n lines) to the console, combined from the test framework and all test nodes.')
231
232
parser.add_argument('--coverage', action='store_true', help='generate a basic coverage report for the RPC interface')
232
233
parser.add_argument('--ci', action='store_true', help='Run checks and code that are usually only enabled in a continuous integration environment')
@@ -239,7 +240,14 @@ def main():
239
240
parser.add_argument('--tmpdirprefix', '-t', default=tempfile.gettempdir(), help="Root directory for datadirs")
240
241
parser.add_argument('--failfast', action='store_true', help='stop execution after the first test failure')
241
242
parser.add_argument('--filter', help='filter scripts to run by regular expression')
243
+
242
244
args, unknown_args=parser.parse_known_args()
245
+
ifnotargs.ansi:
246
+
globalBOLD, GREEN, RED, GREY
247
+
BOLD= ("", "")
248
+
GREEN= ("", "")
249
+
RED= ("", "")
250
+
GREY= ("", "")
243
251
244
252
# args to be passed on always start with two dashes; tests are the remaining unknown args
0 commit comments