Make and use a req_interp helper
authorIan Lynagh <igloo@earth.li>
Wed, 13 Jul 2011 19:57:11 +0000 (20:57 +0100)
committerIan Lynagh <igloo@earth.li>
Wed, 13 Jul 2011 19:57:11 +0000 (20:57 +0100)
Tests can now specify that they require the interpreter (i.e. that
they use one of ghci, annotations, TH, etc).

17 files changed:
testsuite/config/ghc
testsuite/driver/testglobals.py
testsuite/driver/testlib.py
testsuite/tests/ghc-regress/annotations/should_compile/all.T
testsuite/tests/ghc-regress/annotations/should_fail/all.T
testsuite/tests/ghc-regress/driver/all.T
testsuite/tests/ghc-regress/ghc-e/should_run/all.T
testsuite/tests/ghc-regress/ghci/scripts/all.T
testsuite/tests/ghc-regress/ghci/should_run/all.T
testsuite/tests/ghc-regress/layout/all.T
testsuite/tests/ghc-regress/quasiquotation/all.T
testsuite/tests/ghc-regress/quasiquotation/qq001/test.T
testsuite/tests/ghc-regress/quasiquotation/qq002/test.T
testsuite/tests/ghc-regress/quasiquotation/qq003/test.T
testsuite/tests/ghc-regress/quasiquotation/qq004/test.T
testsuite/tests/ghc-regress/safeHaskell/safeLanguage/all.T
testsuite/tests/ghc-regress/th/2014/all.T

index c3b3ef1..4c614d5 100644 (file)
@@ -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)
index 152f0fe..0e4ab05 100644 (file)
@@ -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
 
index 2cac0ef..6f4c530 100644 (file)
@@ -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 )
 
index 851bf92..e13c24e 100644 (file)
@@ -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:
index 9da685a..21eaa76 100644 (file)
@@ -1,19 +1,22 @@
 
 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, [''])
 
 """"
index e1f2ac1..b7cc9e2 100644 (file)
@@ -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'])
index bedaaa1..6039a40 100644 (file)
@@ -1,12 +1,12 @@
 
 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'])
index 627adc9..f3ddbff 100644 (file)
@@ -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'])
 
index 5301fbe..41d65f2 100644 (file)
@@ -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'])
index 17e482e..026ad46 100644 (file)
@@ -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,
index ec046b1..2fa0427 100644 (file)
@@ -1,4 +1,4 @@
-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),
index c1dd1da..2db7546 100644 (file)
@@ -1,2 +1,2 @@
-test('qq001', only_compiler_types(['ghc']),
+test('qq001', [req_interp, only_compiler_types(['ghc'])],
      compile_fail, [''])
index 134a837..2c39664 100644 (file)
@@ -1,2 +1,2 @@
-test('qq002', only_compiler_types(['ghc']),
+test('qq002', [req_interp, only_compiler_types(['ghc'])],
      compile_fail, [''])
index 5bb9343..9c61d0a 100644 (file)
@@ -1,2 +1,2 @@
-test('qq003', only_compiler_types(['ghc']),
+test('qq003', [req_interp, only_compiler_types(['ghc'])],
      compile_fail, [''])
index c0c9cbe..13ecda5 100644 (file)
@@ -1,2 +1,2 @@
-test('qq004', only_compiler_types(['ghc']),
+test('qq004', [req_interp, only_compiler_types(['ghc'])],
      compile_fail, [''])
index 4b2209b..7074c0f 100644 (file)
@@ -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'])
 
index 13138df..c679267 100644 (file)
@@ -1,7 +1,8 @@
 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'])