Commit 90e99343 authored by Simon Marlow's avatar Simon Marlow
Browse files

grab the target architecture from GHC, and add an if_arch() test

parent 0fb72c5a
...@@ -37,6 +37,7 @@ class TestConfig: ...@@ -37,6 +37,7 @@ class TestConfig:
# What platform are we running on? # What platform are we running on?
self.platform = '' self.platform = ''
self.os = '' self.os = ''
self.arch = ''
# What is the wordsize (in bits) of this platform? # What is the wordsize (in bits) of this platform?
self.wordsize = '' self.wordsize = ''
......
...@@ -260,6 +260,12 @@ def if_os( os, f ): ...@@ -260,6 +260,12 @@ def if_os( os, f ):
else: else:
return normal return normal
def if_arch( arch, f ):
if config.arch == arch:
return f
else:
return normal
def if_wordsize( ws, f ): def if_wordsize( ws, f ):
if config.wordsize == str(ws): if config.wordsize == str(ws):
return f return f
......
...@@ -30,6 +30,7 @@ RUNTEST_OPTS = ...@@ -30,6 +30,7 @@ RUNTEST_OPTS =
$(eval $(call get-ghc-rts-field,WORDSIZE,Word size)) $(eval $(call get-ghc-rts-field,WORDSIZE,Word size))
$(eval $(call get-ghc-rts-field,TARGETPLATFORM,Target platform)) $(eval $(call get-ghc-rts-field,TARGETPLATFORM,Target platform))
$(eval $(call get-ghc-rts-field,TargetOS_CPP,Target OS)) $(eval $(call get-ghc-rts-field,TargetOS_CPP,Target OS))
$(eval $(call get-ghc-rts-field,TargetARCH_CPP,Target architecture))
ifeq "$(filter $(TargetOS_CPP), cygwin32 mingw32)" "" ifeq "$(filter $(TargetOS_CPP), cygwin32 mingw32)" ""
exeext = exeext =
else else
...@@ -106,6 +107,7 @@ RUNTEST_OPTS += \ ...@@ -106,6 +107,7 @@ RUNTEST_OPTS += \
-e 'config.gs="$(GS)"' \ -e 'config.gs="$(GS)"' \
-e 'config.platform="$(TARGETPLATFORM)"' \ -e 'config.platform="$(TARGETPLATFORM)"' \
-e 'config.os="$(TargetOS_CPP)"' \ -e 'config.os="$(TargetOS_CPP)"' \
-e 'config.arch="$(TargetARCH_CPP)"' \
-e 'config.wordsize="$(WORDSIZE)"' \ -e 'config.wordsize="$(WORDSIZE)"' \
-e 'default_testopts.cleanup="$(CLEANUP)"' \ -e 'default_testopts.cleanup="$(CLEANUP)"' \
-e 'config.timeout=int($(TIMEOUT)) or config.timeout' \ -e 'config.timeout=int($(TIMEOUT)) or config.timeout' \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment