Commit f2600f8b authored by simonmar's avatar simonmar

[project @ 2002-09-11 10:47:57 by simonmar]

- Move some of the way-selection logic into the configuration file;
  the build system now just passes in variables saying whether the
  compiler supports profiling and native code generation, and the
  configuration file adds the appropriate ways.

- Add a new option to the test driver, --way=<way> to select just a
  single way.
parent 45c9dcce
......@@ -12,9 +12,17 @@ config.compiler_always_flags = ['-no-recomp', '-dcore-lint']
config.compile_ways = ['normal', 'opt']
config.run_ways = ['normal', 'opt']
config.way_flags = { 'normal' : [],
'opt' : ['-O'],
'optasm' : ['-O -fasm'],
'prof' : ['-O -prof -auto-all'],
'unreg' : ['-unreg']
}
if (ghc_with_native_codegen == 1):
config.compile_ways.append('optasm')
config.run_ways.append('optasm')
if (ghc_with_profiling == 1):
config.compile_ways.append('prof')
config.run_ways.append('prof')
config.way_flags = { 'normal' : [],
'opt' : ['-O'],
'optasm' : ['-O -fasm'],
'prof' : ['-O -prof -auto-all'],
'unreg' : ['-unreg']
}
......@@ -30,6 +30,7 @@ long_options = [
"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)
"way=", # just this way
]
opts, args = getopt.getopt(sys.argv[1:], "e:", long_options)
......@@ -52,6 +53,14 @@ for opt,arg in opts:
if opt == '--only':
config.only.append(arg)
if opt == '--way':
if (arg not in config.run_ways and arg not in config.compile_ways):
sys.stderr.write("ERROR: requested way \'" +
arg + "\' does not exist\n")
sys.exit(1)
config.run_ways = filter(eq(arg), config.run_ways)
config.compile_ways = filter(eq(arg), config.compile_ways)
# -----------------------------------------------------------------------------
# The main dude
......
# -----------------------------------------------------------------------------
# Utils
def eq(x):
return lambda y,z=x: y == z
def append(x,y):
return x + y
......
......@@ -30,23 +30,27 @@ CONFIG = $(TOP)/config/ghc
# can be overriden from the command line
TEST_HC = $(GHC_INPLACE_ABS)
RUNTEST_OPTS = \
--config=$(CONFIG) \
-e config.compiler=\"$(TEST_HC)\" \
-e config.compiler_always_flags.append"(\"$(EXTRA_HC_OPTS)\")" \
-e config.platform=\"$(TARGETPLATFORM)\" \
$(EXTRA_RUNTEST_OPTS)
RUNTEST_OPTS =
ifeq "$(GhcWithNativeCodeGen)" "YES"
RUNTEST_OPTS += -e config.compile_ways.append"(\"optasm\")"
RUNTEST_OPTS += -e config.run_ways.append"(\"optasm\")"
RUNTEST_OPTS += -e ghc_with_native_codegen=1
else
RUNTEST_OPTS += -e ghc_with_native_codegen=0
endif
ifeq "$(filter p, $(GhcLibWays))" "p"
RUNTEST_OPTS += -e config.compile_ways.append"(\"prof\")"
RUNTEST_OPTS += -e config.run_ways.append"(\"prof\")"
RUNTEST_OPTS += -e ghc_with_profiling=1
else
RUNTEST_OPTS += -e ghc_with_profiling=0
endif
RUNTEST_OPTS += \
--config=$(CONFIG) \
-e config.compiler=\"$(TEST_HC)\" \
-e config.compiler_always_flags.append"(\"$(EXTRA_HC_OPTS)\")" \
-e config.platform=\"$(TARGETPLATFORM)\" \
$(EXTRA_RUNTEST_OPTS)
TESTS =
TEST =
......
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