From 4ade427debf68718a2b2988562b8be5ce6048972 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Sat, 13 Feb 2021 16:56:50 +0800 Subject: [testlib/driver] denoise this prevents the testlib/driver to be overly noisy, and will also kill some noise produiced by the aarch64-darwin cc (for now). Fixing sysctl, will allow us to run the test's properly in a nix-shell on aarch64-darwin (cherry picked from commit 5109e87e13ab45d799db2013535f54ca35f1f4dc) --- testsuite/driver/cpu_features.py | 5 +++-- testsuite/driver/testlib.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/testsuite/driver/cpu_features.py b/testsuite/driver/cpu_features.py index 7b4340b61c..6e32d3b445 100644 --- a/testsuite/driver/cpu_features.py +++ b/testsuite/driver/cpu_features.py @@ -29,7 +29,9 @@ def get_cpu_features(): return flags elif config.os == 'darwin': - out = subprocess.check_output(['sysctl', 'hw']).decode('UTF-8') + # we hardcode the sysctl path, otherwise we rely on /usr/sbin being in + # path. + out = subprocess.check_output(['/usr/sbin/sysctl', 'hw']).decode('UTF-8') features = set() def check_feature(darwin_name, our_name=None): if re.search(r'hw\.optional.%s:\s*1' % darwin_name, out) is not None: @@ -66,4 +68,3 @@ if __name__ == '__main__': import sys config.os = sys.argv[1] print(get_cpu_features()) - diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index b5d2744e58..eab13ec40c 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1809,9 +1809,10 @@ def interpreter_run(name: TestName, # check the exit code if exit_code != getTestOpts().exit_code: - print('Wrong exit code for ' + name + '(' + way + ') (expected', getTestOpts().exit_code, ', actual', exit_code, ')') - dump_stdout(name) - dump_stderr(name) + if config.verbose >= 1 and _expect_pass(way): + print('Wrong exit code for ' + name + '(' + way + ') (expected', getTestOpts().exit_code, ', actual', exit_code, ')') + dump_stdout(name) + dump_stderr(name) message = format_bad_exit_code_message(exit_code) return failBecause(message, stderr=read_stderr(name), @@ -2238,7 +2239,8 @@ def normalise_errmsg(s: str) -> str: # filter out nix garbage, that just keeps on showing up as errors on darwin s = modify_lines(s, lambda l: re.sub('^(.+)\.dylib, ignoring unexpected dylib file$','', l)) - + s = re.sub('ld: warning: passed two min versions \(10.16.0, 10.12\) for platform macOS. Using 10.12.','',s) + s = re.sub('ld: warning: -sdk_version and -platform_version are not compatible, ignoring -sdk_version','',s) return s # normalise a .prof file, so that we can reasonably compare it against @@ -2312,6 +2314,8 @@ def normalise_output( s: str ) -> str: # ghci outputs are pretty unstable with -fexternal-dynamic-refs, which is # requires for -fPIC s = re.sub(' -fexternal-dynamic-refs\n','',s) + s = re.sub('ld: warning: passed .* min versions \(.*\) for platform macOS. Using [\.0-9]+.','',s) + s = re.sub('ld: warning: -sdk_version and -platform_version are not compatible, ignoring -sdk_version','',s) return s def normalise_asm( s: str ) -> str: -- cgit v1.2.1