diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2021-02-13 16:56:50 +0800 |
---|---|---|
committer | Moritz Angermann <moritz.angermann@gmail.com> | 2021-05-07 09:17:22 +0800 |
commit | 41b0c2889f0e4c4fbcb6ca97a4bf28b697bf8b92 (patch) | |
tree | 548c123d11f7b773f861f5f4e4c35ac75648a2ab | |
parent | c5454dc7467cf6f51d9ab27430271abee5628f6d (diff) | |
download | haskell-41b0c2889f0e4c4fbcb6ca97a4bf28b697bf8b92.tar.gz |
[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)
-rw-r--r-- | testsuite/driver/cpu_features.py | 5 | ||||
-rw-r--r-- | 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 f0a52bdefb..304059f430 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1811,9 +1811,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), @@ -2240,7 +2241,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 @@ -2314,6 +2316,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: |