Commit af63209d authored by Ian Lynagh's avatar Ian Lynagh

Make and use a req_interp helper

Tests can now specify that they require the interpreter (i.e. that
they use one of ghci, annotations, TH, etc).
parent 04801365
......@@ -40,6 +40,7 @@ if (ghc_with_profiling == 1):
config.run_ways.append('profasm')
if (ghc_with_interpreter == 1):
config.have_interp = True
config.run_ways.append('ghci')
config.unregisterised = (ghc_unregisterised == 1)
......
......@@ -81,6 +81,9 @@ class TestConfig:
# Do we have profiling support?
self.have_profiling = False
# Do we have interpreter support?
self.have_interp = False
# Do we have shared libraries?
self.have_shared_libs = False
......
......@@ -114,6 +114,10 @@ def req_profiling( opts ):
if not config.have_profiling:
opts.expect = 'fail'
def req_interp( opts ):
if not config.have_interp:
opts.expect = 'fail'
def expect_broken( bug ):
return lambda opts, b=bug: _expect_broken (opts, b )
......
......@@ -5,7 +5,10 @@ setTestOpts(if_compiler_profiled(skip))
# order for this to work with profiling, we would have to build the
# program twice and use -osuf p_o (see the TH_splitE5_prof test). For
# now, just disable the profiling ways.
test('ann01', omit_ways(['profasm','profthreaded']), compile, ['-v0'])
test('ann01',
[req_interp, omit_ways(['profasm','profthreaded'])],
compile,
['-v0'])
""""
Helpful things to C+P:
......
test('annfail01', normal, compile_fail, [''])
test('annfail02', normal, compile_fail, [''])
test('annfail03', normal, compile_fail, [''])
test('annfail04', extra_clean(['Annfail04_Help.hi', 'Annfail04_Help.o']),
test('annfail03', req_interp, compile_fail, [''])
test('annfail04',
[req_interp, extra_clean(['Annfail04_Help.hi', 'Annfail04_Help.o'])],
multimod_compile_fail, ['annfail04', '-v0'])
test('annfail05', extra_clean(['Annfail05_Help.hi', 'Annfail05_Help.o']),
test('annfail05',
[req_interp, extra_clean(['Annfail05_Help.hi', 'Annfail05_Help.o'])],
multimod_compile_fail, ['annfail05', '-v0'])
test('annfail06', extra_clean(['Annfail06_Help.hi', 'Annfail06_Help.o']),
test('annfail06',
[req_interp, extra_clean(['Annfail06_Help.hi', 'Annfail06_Help.o'])],
multimod_compile_fail, ['annfail06', '-v0'])
test('annfail07', normal, compile_fail, [''])
test('annfail08', normal, compile_fail, [''])
test('annfail09', normal, compile_fail, [''])
test('annfail10', normal, compile_fail, [''])
test('annfail07', req_interp, compile_fail, [''])
test('annfail08', req_interp, compile_fail, [''])
test('annfail09', req_interp, compile_fail, [''])
test('annfail10', req_interp, compile_fail, [''])
test('annfail11', normal, compile_fail, [''])
test('annfail12', normal, compile_fail, ['-v0'])
test('annfail12', req_interp, compile_fail, ['-v0'])
test('annfail13', normal, compile_fail, [''])
""""
......
......@@ -322,4 +322,4 @@ test('T4437', only_ways(['normal']), compile_and_run, ['-package ghc'])
test('werror', normal, compile_fail, [''])
test('T706', normal, run_command, ['$MAKE -s --no-print-directory T706'])
test('T706', req_interp, run_command, ['$MAKE -s --no-print-directory T706'])
setTestOpts(if_compiler_profiled(skip))
test('ghc-e001', normal, run_command, ['$MAKE --no-print-directory -s ghc-e001'])
test('ghc-e002', normal, run_command, ['$MAKE --no-print-directory -s ghc-e002'])
test('ghc-e003', normal, run_command, ['$MAKE --no-print-directory -s ghc-e003'])
test('ghc-e004', normal, run_command, ['$MAKE --no-print-directory -s ghc-e004'])
test('ghc-e005', normal, run_command, ['$MAKE --no-print-directory -s ghc-e005'])
test('ghc-e001', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e001'])
test('ghc-e002', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e002'])
test('ghc-e003', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e003'])
test('ghc-e004', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e004'])
test('ghc-e005', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e005'])
test('2228', normal, run_command, ['$MAKE --no-print-directory -s 2228'])
test('2636', normal, run_command, ['$MAKE --no-print-directory -s 2636'])
test('3890', normal, run_command, ['$MAKE --no-print-directory -s 3890'])
test('2228', req_interp, run_command, ['$MAKE --no-print-directory -s 2228'])
test('2636', req_interp, run_command, ['$MAKE --no-print-directory -s 2636'])
test('3890', req_interp, run_command, ['$MAKE --no-print-directory -s 3890'])
......@@ -53,7 +53,7 @@ test('ghci033', normal, ghci_script, ['ghci033.script'])
test('ghci034', normal, ghci_script, ['ghci034.script'])
test('ghci035', normal, ghci_script, ['ghci035.script'])
test('ghci036', normal, ghci_script, ['ghci036.script'])
test('ghci037', normal, run_command, ['$MAKE -s --no-print-directory ghci037'])
test('ghci037', req_interp, run_command, ['$MAKE -s --no-print-directory ghci037'])
test('2452', normal, ghci_script, ['2452.script'])
test('T2766', normal, ghci_script, ['T2766.script'])
......
......@@ -11,5 +11,8 @@ test('ghcirun003', just_ghci, compile_and_run, [''])
test('2589', just_ghci, compile_and_run, [''])
test('2881', just_ghci, compile_and_run, [''])
test('3171', if_platform('i386-unknown-mingw32',skip), run_command,
test('3171',
[if_platform('i386-unknown-mingw32',skip),
req_interp],
run_command,
['$MAKE -s --no-print-directory 3171'])
......@@ -36,7 +36,8 @@ test('layout006',
['$MAKE -s --no-print-directory layout006'])
test('layout007',
[extra_clean(['layout007.hi', 'layout007.o']),
[req_interp,
extra_clean(['layout007.hi', 'layout007.o']),
only_compiler_types(['ghc']),
if_compiler_profiled(skip)],
run_command,
......
test('T3953', only_compiler_types(['ghc']), compile_fail, [''])
test('T3953', [req_interp, only_compiler_types(['ghc'])], compile_fail, [''])
test('T4150',
[only_compiler_types(['ghc']),
expect_broken(4150),
......
test('qq001', only_compiler_types(['ghc']),
test('qq001', [req_interp, only_compiler_types(['ghc'])],
compile_fail, [''])
test('qq002', only_compiler_types(['ghc']),
test('qq002', [req_interp, only_compiler_types(['ghc'])],
compile_fail, [''])
test('qq003', only_compiler_types(['ghc']),
test('qq003', [req_interp, only_compiler_types(['ghc'])],
compile_fail, [''])
test('qq004', only_compiler_types(['ghc']),
test('qq004', [req_interp, only_compiler_types(['ghc'])],
compile_fail, [''])
......@@ -14,6 +14,6 @@ test('SafeLang07', normal, compile_fail, [''])
test('SafeLang08', normal, compile_fail, [''])
test('SafeLang09', exit_code(1), compile_and_run, [''])
test('SafeLang10', normal, compile_fail, ['--make -trust base'])
test('SafeLang11', normal, compile_and_run, ['--make -trust base'])
test('SafeLang11', req_interp, compile_and_run, ['--make -trust base'])
test('SafeLang12', normal, compile_fail, ['--make -trust base'])
setTestOpts(if_compiler_profiled(skip))
test('2014',
extra_clean(['A.hi-boot','A.hi','A.o','A.o-boot',
'B.hi', 'B.o', 'C.hi', 'C.o']),
[req_interp,
extra_clean(['A.hi-boot','A.hi','A.o','A.o-boot',
'B.hi', 'B.o', 'C.hi', 'C.o'])],
run_command,
['$MAKE -s --no-print-directory 2014'])
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