summaryrefslogtreecommitdiff
path: root/testsuite/driver
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/driver')
-rw-r--r--testsuite/driver/cpu_features.py5
-rw-r--r--testsuite/driver/runtests.py7
-rw-r--r--testsuite/driver/testlib.py27
3 files changed, 26 insertions, 13 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/runtests.py b/testsuite/driver/runtests.py
index d4425b5da5..ac0d4f7100 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -266,7 +266,7 @@ def format_path(path):
# On Windows we need to set $PATH to include the paths to all the DLLs
# in order for the dynamic library tests to work.
-if windows or darwin:
+if windows:
pkginfo = getStdout([config.ghc_pkg, 'dump'])
topdir = config.libdir
if windows:
@@ -284,12 +284,9 @@ if windows or darwin:
if path.startswith('"'):
path = re.sub('^"(.*)"$', '\\1', path)
path = re.sub('\\\\(.)', '\\1', path)
- if windows:
+
path = format_path(path)
ghc_env['PATH'] = os.pathsep.join([path, ghc_env.get("PATH", "")])
- else:
- # darwin
- ghc_env['DYLD_LIBRARY_PATH'] = os.pathsep.join([path, ghc_env.get("DYLD_LIBRARY_PATH", "")])
testopts_local.x = TestOptions()
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index b5d2744e58..3c82a7de2f 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),
@@ -2236,9 +2237,14 @@ def normalise_errmsg(s: str) -> str:
# and not understood by older binutils (ar, ranlib, ...)
s = modify_lines(s, lambda l: re.sub('^(.+)warning: (.+): unsupported GNU_PROPERTY_TYPE \(5\) type: 0xc000000(.*)$', '', l))
- # 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 .* 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)
+ # ignore superfluous dylibs passed to the linker.
+ s = re.sub('ld: warning: .*, ignoring unexpected dylib file\n','',s)
+ # ignore LLVM Version mismatch garbage; this will just break tests.
+ s = re.sub('You are using an unsupported version of LLVM!.*\n','',s)
+ s = re.sub('Currently only [\.0-9]+ is supported. System LLVM version: [\.0-9]+.*\n','',s)
+ s = re.sub('We will try though\.\.\..*\n','',s)
return s
# normalise a .prof file, so that we can reasonably compare it against
@@ -2312,6 +2318,15 @@ 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)
+ # ignore superfluous dylibs passed to the linker.
+ s = re.sub('ld: warning: .*, ignoring unexpected dylib file\n','',s)
+ # ignore LLVM Version mismatch garbage; this will just break tests.
+ s = re.sub('You are using an unsupported version of LLVM!.*\n','',s)
+ s = re.sub('Currently only [\.0-9]+ is supported. System LLVM version: [\.0-9]+.*\n','',s)
+ s = re.sub('We will try though\.\.\..*\n','',s)
+
return s
def normalise_asm( s: str ) -> str: