Add better support for .cmm test files.
authorAustin Seipp <mad.one@gmail.com>
Sun, 13 Jan 2013 09:41:29 +0000 (03:41 -0600)
committerAustin Seipp <mad.one@gmail.com>
Thu, 17 Jan 2013 06:02:34 +0000 (00:02 -0600)
Fixes Trac #7573.

Signed-off-by: Austin Seipp <mad.one@gmail.com>
testsuite/driver/testglobals.py
testsuite/driver/testlib.py

index 10a1105..500e7f4 100644 (file)
@@ -237,6 +237,9 @@ class TestOptions:
        self.objc_src   = 0
        self.objcpp_src = 0
 
+       # Does this test use a .cmm file?
+       self.cmm_src    = 0
+
        # Should we put .hi/.o files in a subdirectory?
        self.outputdir = None
 
index 0332d92..fd11be1 100644 (file)
@@ -517,6 +517,9 @@ def objc_src( opts ):
 def objcpp_src( opts ):
     opts.objcpp_src = 1;
 
+def cmm_src( opts ):
+    opts.cmm_src = 1;
+
 def outputdir( odir ):
     return lambda opts, d=odir: _outputdir(opts, d)
 
@@ -1205,7 +1208,8 @@ def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link, addsuf,
     # Required by GHC 7.3+, harmless for earlier versions:
     if (getTestOpts().c_src or
         getTestOpts().objc_src or
-        getTestOpts().objcpp_src):
+        getTestOpts().objcpp_src or
+        getTestOpts().cmm_src):
         extra_hc_opts += ' -no-hs-main '
 
     if getTestOpts().compile_cmd_prefix == '':
@@ -2111,6 +2115,8 @@ def add_suffix( name, suffix ):
 def add_hs_lhs_suffix(name):
     if getTestOpts().c_src:
         return add_suffix(name, 'c')
+    elif getTestOpts().cmm_src:
+        return add_suffix(name, 'cmm')
     elif getTestOpts().objc_src:
         return add_suffix(name, 'm')
     elif getTestOpts().objcpp_src: