diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2021-02-13 16:56:50 +0800 |
---|---|---|
committer | Moritz Angermann <moritz.angermann@gmail.com> | 2021-02-15 20:50:07 -0500 |
commit | 5109e87e13ab45d799db2013535f54ca35f1f4dc (patch) | |
tree | 1365650d287bb8ce7917b44c893b1b8e419ee95f | |
parent | ec0f15837f08e6d71abf160a76f125bc8c77477b (diff) | |
download | haskell-5109e87e13ab45d799db2013535f54ca35f1f4dc.tar.gz |
[testlib/driver] denoisewip/angerman/denoise-testlib-driver
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
-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 c950bc4bbf..3e7b250561 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1706,9 +1706,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) return failBecause('bad exit code (%d)' % exit_code, stderr=read_stderr(name), stdout=read_stdout(name)) @@ -2126,7 +2127,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 @@ -2200,6 +2202,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: |