From f588138bbe0dd25b413377b126ad395a5f6add2d Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Tue, 7 Apr 2020 15:03:31 +1000 Subject: [PATCH] tests/run-multitests.py: Allow filtering out lines from stdout. And use this new feature to filter out certain lines in the Bluetooth multitests. --- tests/run-multitests.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/run-multitests.py b/tests/run-multitests.py index c8e537d4b2..3817fbed70 100755 --- a/tests/run-multitests.py +++ b/tests/run-multitests.py @@ -58,6 +58,15 @@ instance{}() multitest.flush() """ +# The btstack implementation on Unix generates some spurious output that we +# can't control. +IGNORE_OUTPUT_MATCHES = ( + "libusb: error ", # It tries to open devices that it doesn't have access to (libusb prints unconditionally). + "hci_transport_h2_libusb.c", # Same issue. We enable LOG_ERROR in btstack. + "USB Path: ", # Hardcoded in btstack's libusb transport. + "hci_number_completed_packet", # Warning from btstack. +) + class PyInstance: def __init__(self): @@ -239,7 +248,7 @@ def run_test_on_instances(test_file, num_instances, instances): time.sleep(0.1) continue last_read_time = time.time() - if out is not None: + if out is not None and not any(m in out for m in IGNORE_OUTPUT_MATCHES): trace_instance_output(idx, out) if out.startswith("SET "): injected_globals += out[4:] + "\n"