Ticket #7573: 0001-Add-better-support-for-.cmm-test-files.patch

File 0001-Add-better-support-for-.cmm-test-files.patch, 1.9 KB (added by thoughtpolice, 3 years ago)

Initial patch.

  • driver/testglobals.py

    From 5d1d45a48c49ffe0e068dfd702d6a6c30a26a5da Mon Sep 17 00:00:00 2001
    From: Austin Seipp <[email protected]>
    Date: Sun, 13 Jan 2013 03:41:29 -0600
    Subject: [PATCH] Add better support for .cmm test files.
    
    Fixes Trac #7573.
    
    Signed-off-by: Austin Seipp <[email protected]>
    ---
     driver/testglobals.py | 3 +++
     driver/testlib.py     | 8 +++++++-
     2 files changed, 10 insertions(+), 1 deletion(-)
    
    diff --git a/driver/testglobals.py b/driver/testglobals.py
    index 10a1105..500e7f4 100644
    a b class TestOptions: 
    237237       self.objc_src   = 0
    238238       self.objcpp_src = 0
    239239
     240       # Does this test use a .cmm file?
     241       self.cmm_src    = 0
     242
    240243       # Should we put .hi/.o files in a subdirectory?
    241244       self.outputdir = None
    242245
  • driver/testlib.py

    diff --git a/driver/testlib.py b/driver/testlib.py
    index 0332d92..fd11be1 100644
    a b def objc_src( opts ): 
    517517def objcpp_src( opts ):
    518518    opts.objcpp_src = 1;
    519519
     520def cmm_src( opts ):
     521    opts.cmm_src = 1;
     522
    520523def outputdir( odir ):
    521524    return lambda opts, d=odir: _outputdir(opts, d)
    522525
    def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link, addsuf, 
    12051208    # Required by GHC 7.3+, harmless for earlier versions:
    12061209    if (getTestOpts().c_src or
    12071210        getTestOpts().objc_src or
    1208         getTestOpts().objcpp_src):
     1211        getTestOpts().objcpp_src or
     1212        getTestOpts().cmm_src):
    12091213        extra_hc_opts += ' -no-hs-main '
    12101214
    12111215    if getTestOpts().compile_cmd_prefix == '':
    def add_suffix( name, suffix ): 
    21112115def add_hs_lhs_suffix(name):
    21122116    if getTestOpts().c_src:
    21132117        return add_suffix(name, 'c')
     2118    elif getTestOpts().cmm_src:
     2119        return add_suffix(name, 'cmm')
    21142120    elif getTestOpts().objc_src:
    21152121        return add_suffix(name, 'm')
    21162122    elif getTestOpts().objcpp_src: