summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/driver/runtests.py9
-rw-r--r--testsuite/mk/test.mk28
2 files changed, 24 insertions, 13 deletions
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index fcfad77d1a..72e14192e9 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -40,7 +40,8 @@ config = getConfig() # get it from testglobals
# cmd-line options
long_options = [
- "config=", # config file
+ "configfile=", # config file
+ "config=", # config field
"rootdir=", # root of tree containing tests (default: .)
"output-summary=", # file in which to save the (human-readable) summary
"only=", # just this test (can be give multiple --only= flags)
@@ -55,7 +56,7 @@ long_options = [
opts, args = getopt.getopt(sys.argv[1:], "e:", long_options)
for opt,arg in opts:
- if opt == '--config':
+ if opt == '--configfile':
exec(open(arg).read())
# -e is a string to execute from the command line. For example:
@@ -63,6 +64,10 @@ for opt,arg in opts:
if opt == '-e':
exec(arg)
+ if opt == '--config':
+ field, value = arg.split('=', 1)
+ setattr(config, field, value)
+
if opt == '--rootdir':
config.rootdirs.append(arg)
diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk
index 9927b6de1c..7e5b038e1a 100644
--- a/testsuite/mk/test.mk
+++ b/testsuite/mk/test.mk
@@ -194,7 +194,7 @@ endif
RUNTEST_OPTS += \
--rootdir=. \
- --config=$(CONFIG) \
+ --configfile=$(CONFIG) \
-e 'config.confdir="$(CONFIGDIR)"' \
-e 'config.platform="$(TARGETPLATFORM)"' \
-e 'config.os="$(TargetOS_CPP)"' \
@@ -205,17 +205,23 @@ RUNTEST_OPTS += \
-e 'config.exeext="$(exeext)"' \
-e 'config.top="$(TOP_ABS)"'
-# Put an extra pair of quotes around non-empty program paths,
-# so we don't have to in .T scripts or driver/testlib.py.
-quote_path = $(if $1,"\"$1\"","")
+# Wrap non-empty program paths in quotes, because they may contain spaces. Do
+# it here, so we don't have to (and don't forget to do it) in the .T test
+# scripts (search for '{compiler}' or '{hpc}'). This may or may not be a good
+# idea.
+# Use `--config` instead of `-e`, because `-e` (which calls Python's `eval`
+# function) would require another pair of (escaped) quotes, which interfers
+# with MinGW's magic path handling (see #10449, and
+# http://www.mingw.org/wiki/Posix_path_conversion).
+quote_path = $(if $1,"$1")
RUNTEST_OPTS += \
- -e 'config.compiler=$(call quote_path,$(TEST_HC))' \
- -e 'config.ghc_pkg=$(call quote_path,$(GHC_PKG))' \
- -e 'config.haddock=$(call quote_path,$(HADDOCK))' \
- -e 'config.hp2ps=$(call quote_path,$(HP2PS_ABS))' \
- -e 'config.hpc=$(call quote_path,$(HPC))' \
- -e 'config.gs=$(call quote_path,$(GS))' \
- -e 'config.timeout_prog=$(call quote_path,$(TIMEOUT_PROGRAM))'
+ --config 'compiler=$(call quote_path,$(TEST_HC))' \
+ --config 'ghc_pkg=$(call quote_path,$(GHC_PKG))' \
+ --config 'haddock=$(call quote_path,$(HADDOCK))' \
+ --config 'hp2ps=$(call quote_path,$(HP2PS_ABS))' \
+ --config 'hpc=$(call quote_path,$(HPC))' \
+ --config 'gs=$(call quote_path,$(GS))' \
+ --config 'timeout_prog=$(call quote_path,$(TIMEOUT_PROGRAM))'
ifneq "$(OUTPUT_SUMMARY)" ""
RUNTEST_OPTS += \