Commit effc8af9 authored by ian@well-typed.com's avatar ian@well-typed.com

Pass the test name to the test options

This allows them to give framework failures.

I also had to change how setTestOpts works. Now, rather than applying
the options to the directory's "default options", it just stores the
options to be applied for each test (i.e. once we know the test name).
parent de7e357c
......@@ -207,9 +207,6 @@ if windows or darwin:
global testopts_local
testopts_local.x = TestOptions()
global thisdir_testopts
thisdir_testopts = getThisDirTestOpts()
if config.use_threads:
t.lock = threading.Lock()
t.thread_pool = threading.Condition(t.lock)
......
This diff is collapsed.
......@@ -77,7 +77,7 @@ test('T5866', exit_code(1), compile_and_run, [''])
# -----------------------------------------------------------------------------
# These tests we only do for a full run
def f( opts ):
def f( name, opts ):
if config.fast:
opts.skip = 1
......
# Just do the opt way...
def f( opts ):
def f( name, opts ):
opts.only_ways = ['optasm']
setTestOpts(f)
......
# Just do the normal way...
def f( opts ):
def f( name, opts ):
opts.only_ways = ['normal']
setTestOpts(f)
......
def ffi( opts ):
def ffi( name, opts ):
opts.extra_hc_opts = '-XForeignFunctionInterface -optc-Wno-implicit'
setTestOpts(ffi)
......
setTestOpts(only_compiler_types(['ghc']))
def f(opts):
def f(name, opts):
if not ('ghci' in config.run_ways):
opts.skip = 1
setTestOpts(f)
......
......@@ -2,7 +2,7 @@
setTestOpts(if_compiler_profiled(skip))
# We only want to run these tests with GHCi
def just_ghci( opts ):
def just_ghci( name, opts ):
opts.only_ways = ['ghci']
test('ghcirun001', just_ghci, compile_and_run, [''])
......
# Tests for LLVM code generator
def f( opts ):
def f( name, opts ):
opts.only_ways = ['optllvm', 'llvm', 'debugllvm']
setTestOpts(f)
......
def no_lint(opts):
def no_lint(name, opts):
opts.compiler_always_flags = \
filter(lambda opt: opt != '-dcore-lint' and opt != '-dcmm-lint', opts.compiler_always_flags)
......
def f(opts):
def f(name, opts):
if (ghc_with_interpreter == 0):
opts.skip = 1
......
# this one causes the compiler to run out of heap in the simplifier
def set_opts( opts ):
def set_opts( name, opts ):
opts.expect = 'fail'
test('okeefe_neural',
......
......@@ -115,7 +115,7 @@ test('return_mem_to_os', normal, compile_and_run, [''])
test('T4850', normal, run_command, ['$MAKE -s --no-print-directory T4850'])
def config_T5250(opts):
def config_T5250(name, opts):
if not (config.arch in ['i386','x86_64']):
opts.skip = 1;
......
......@@ -2,7 +2,7 @@
# check of safe haskell is working properly.
# Just do the normal way, SafeHaskell is all in the frontend
def f( opts ):
def f( name, opts ):
opts.only_ways = ['normal']
setTestOpts(f)
......
# Just do the normal way, SafeHaskell is all in the frontend
def f( opts ):
def f( name, opts ):
opts.only_ways = ['normal']
def normaliseArrayPackage(str):
......
......@@ -4,7 +4,7 @@
# has been dropped.
# Just do the normal way, SafeHaskell is all in the frontend
def f( opts ):
def f( name, opts ):
opts.only_ways = ['normal']
setTestOpts(f)
......
......@@ -2,7 +2,7 @@
# mode safe inference works correctly.
# Just do the normal way, SafeHaskell is all in the frontend
def f( opts ):
def f( name, opts ):
opts.only_ways = ['normal']
setTestOpts(f)
......
......@@ -4,7 +4,7 @@
# works correctly (incluidng testing safe imports a little).
# Just do the normal way, SafeHaskell is all in the frontend
def f( opts ):
def f( name, opts ):
opts.only_ways = ['normal']
setTestOpts(f)
......
......@@ -4,7 +4,7 @@
# Checking base package is properly safe basically
# Just do the normal way, SafeHaskell is all in the frontend
def f( opts ):
def f( name, opts ):
opts.only_ways = ['normal']
setTestOpts(f)
......
......@@ -4,7 +4,7 @@
# expected process return value, if not zero
# Only compile with optimisation
def f( opts ):
def f( name, opts ):
opts.only_ways = ['optasm']
setTestOpts(f)
......
def f(opts):
def f(name, opts):
opts.extra_hc_opts = '-XTemplateHaskell -package template-haskell'
if (ghc_with_interpreter == 0):
opts.skip = 1
......
......@@ -3,7 +3,7 @@
# to run it !if_compiler_profiled
test('T4255', unless_compiler_profiled(skip), compile_fail, ['-v0'])
def f(opts):
def f(name, opts):
opts.extra_hc_opts = '-XTemplateHaskell -package template-haskell'
if (ghc_with_interpreter == 0):
opts.skip = 1
......
# Args to vtc are: extra compile flags
def f( opts ):
def f( name, opts ):
opts.extra_hc_opts = '-fno-warn-incomplete-patterns'
setTestOpts(f)
......
......@@ -16,7 +16,7 @@ test('Defer01', normal, compile_and_run, [''])
# -----------------------------------------------------------------------------
# Skip everything else if fast is on
def f(opts):
def f(name, opts):
if config.fast:
opts.skip = 1
setTestOpts(f)
......
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