[commit: testsuite] master: Use .hpc.<testname> for the hpc directory (413dd2f)

Ian Lynagh igloo at earth.li
Thu Jan 24 19:19:36 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/413dd2fbd98bf411e30762b0e6800d3e6119da8e

>---------------------------------------------------------------

commit 413dd2fbd98bf411e30762b0e6800d3e6119da8e
Author: Ian Lynagh <ian at well-typed.com>
Date:   Thu Jan 24 17:31:32 2013 +0000

    Use .hpc.<testname> for the hpc directory
    
    All tests used to use .hpc, which caused failures when running in
    parallel.

>---------------------------------------------------------------

 config/ghc        |   10 +++++-----
 driver/testlib.py |    8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/config/ghc b/config/ghc
index 73ff7d3..da7cc3a 100644
--- a/config/ghc
+++ b/config/ghc
@@ -80,7 +80,7 @@ if (ghc_with_llvm == 1):
 config.in_tree_compiler = in_tree_compiler
 config.clean_only       = clean_only
 
-config.way_flags = {
+config.way_flags = lambda name : {
     'normal'       : [],
     'g1'           : [],
     'optasm'       : ['-O', '-fasm'],
@@ -97,7 +97,7 @@ config.way_flags = {
     'threaded1_ls' : ['-threaded', '-debug'],
     'threaded2'    : ['-O', '-threaded', '-eventlog'],
     'threaded2_hT' : ['-O', '-threaded'],
-    'hpc'          : ['-O', '-fhpc' ],
+    'hpc'          : ['-O', '-fhpc', '-hpcdir', '.hpc.' + name ],
     'prof_hc_hb'   : ['-O', '-prof', '-static', '-auto-all'],
     'prof_hb'      : ['-O', '-prof', '-static', '-auto-all'],
     'prof_hd'      : ['-O', '-prof', '-static', '-auto-all'],
@@ -153,15 +153,15 @@ config.way_rts_flags = {
 
 prof_ways = map (lambda x: x[0], \
                  filter(lambda x: '-prof' in x[1], \
-                        config.way_flags.items()))
+                        config.way_flags('dummy_name').items()))
 
 threaded_ways = map (lambda x: x[0], \
                  filter(lambda x: '-threaded' in x[1] or 'ghci' == x[0], \
-                        config.way_flags.items()))
+                        config.way_flags('dummy_name').items()))
 
 opt_ways = map (lambda x: x[0], \
                  filter(lambda x: '-O' in x[1], \
-                        config.way_flags.items()))
+                        config.way_flags('dummy_name').items()))
 
 def get_compiler_info():
 # This should really not go through the shell
diff --git a/driver/testlib.py b/driver/testlib.py
index 4868e6d..f21b380 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -1229,7 +1229,7 @@ def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link, addsuf,
           + config.compiler + "' " \
           + join(comp_flags,' ') + ' ' \
           + to_do + ' ' + srcname + ' ' \
-          + join(config.way_flags[way],' ') + ' ' \
+          + join(config.way_flags(name)[way],' ') + ' ' \
           + extra_hc_opts + ' ' \
           + opts.extra_hc_opts + ' ' \
           + '>' + errname + ' 2>&1'
@@ -1415,7 +1415,7 @@ def interpreter_run( name, way, extra_hc_opts, compile_only, top_mod ):
     cmd = "'" + config.compiler + "' " \
           + join(flags,' ') + ' ' \
           + srcname + ' ' \
-          + join(config.way_flags[way],' ') + ' ' \
+          + join(config.way_flags(name)[way],' ') + ' ' \
           + extra_hc_opts + ' ' \
           + getTestOpts().extra_hc_opts + ' ' \
           + '<' + scriptname +  ' 1>' + outname + ' 2>' + errname
@@ -1511,7 +1511,7 @@ def extcore_run( name, way, extra_hc_opts, compile_only, top_mod ):
     cmd = 'cd ' + getTestOpts().testdir + " && '" \
           + config.compiler + "' " \
           + join(flags,' ') + ' ' \
-          + join(config.way_flags[way],' ') + ' ' \
+          + join(config.way_flags(name)[way],' ') + ' ' \
           + extra_hc_opts + ' ' \
           + getTestOpts().extra_hc_opts \
           + to_do \
@@ -1536,7 +1536,7 @@ def extcore_run( name, way, extra_hc_opts, compile_only, top_mod ):
         deplist2 = string.replace(deplist,'.lhs,', '.hcr');
         to_compile = string.replace(deplist2,'.hs,', '.hcr');
 
-    flags = join(filter(lambda f: f != '-fext-core',config.way_flags[way]),' ')
+    flags = join(filter(lambda f: f != '-fext-core',config.way_flags(name)[way]),' ')
     if getTestOpts().outputdir != None:
         flags.extend(["-outputdir", getTestOpts().outputdir])
 





More information about the ghc-commits mailing list