From 27df8a62a46aa0ef6776b6f505a6390fc989754d Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 21 Sep 2010 23:47:51 +0000 Subject: [PATCH] Add an if_compiler_profiled helper and use it to skip the th, ghci and debugger tests when GHC is profiled. --- testsuite/config/ghc | 18 ++++++++++++++---- testsuite/driver/testlib.py | 6 ++++++ .../ghc-regress/ghci.debugger/scripts/all.T | 4 +++- .../ghci.debugger/scripts/break022/all.T | 2 +- .../ghci.debugger/scripts/break023/all.T | 2 +- testsuite/tests/ghc-regress/ghci/scripts/all.T | 3 +++ testsuite/tests/ghc-regress/th/2014/all.T | 2 ++ .../th/TH_import_loop/TH_import_loop.T | 2 ++ .../tests/ghc-regress/th/TH_recompile/all.T | 1 + testsuite/tests/ghc-regress/th/all.T | 1 + 10 files changed, 34 insertions(+), 7 deletions(-) diff --git a/testsuite/config/ghc b/testsuite/config/ghc index 2e14a37328..dc630d2e78 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -120,12 +120,22 @@ threaded_ways = filter(lambda x: x in config.run_ways, def get_compiler_info(): # This should really not go through the shell - h = os.popen('"' + config.compiler + '" --numeric-version', 'r') - v = h.read() + h = os.popen('"' + config.compiler + '" --info', 'r') + s = h.read() h.close() - v = re.sub('[\r\n]', '', v) - v = v.split('-') + compilerInfoDict = dict(eval(s)) + h = os.popen('"' + config.compiler + '" +RTS --info', 'r') + s = h.read() + h.close() + rtsInfoDict = dict(eval(s)) + + v = compilerInfoDict["Project version"].split('-') config.compiler_version = v[0] config.compiler_maj_version = re.sub('^([0-9]+\.[0-9]+).*',r'\1', v[0]) config.compiler_tags = v[1:] + if re.match(".*_p(_.*|$)", rtsInfoDict["RTS way"]): + config.compiler_profiled = True + else: + config.compiler_profiled = False + diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index a09d76286b..21b0f3c1c7 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -292,6 +292,12 @@ def if_compiler_type( compiler, f ): else: return normal +def if_compiler_profiled( f ): + if config.compiler_profiled: + return f + else: + return normal + def if_compiler_lt( compiler, version, f ): if config.compiler_type == compiler and \ version_lt(config.compiler_version, version): diff --git a/testsuite/tests/ghc-regress/ghci.debugger/scripts/all.T b/testsuite/tests/ghc-regress/ghci.debugger/scripts/all.T index 322e75f6a0..e75a518881 100644 --- a/testsuite/tests/ghc-regress/ghci.debugger/scripts/all.T +++ b/testsuite/tests/ghc-regress/ghci.debugger/scripts/all.T @@ -1,4 +1,6 @@ -setTestOpts(composes([extra_run_opts('-ignore-dot-ghci'), normalise_slashes])) +setTestOpts(composes([extra_run_opts('-ignore-dot-ghci'), + if_compiler_profiled(skip), + normalise_slashes])) test('print001', normal, ghci_script, ['print001.script']) test('print002', normal, ghci_script, ['print002.script']) diff --git a/testsuite/tests/ghc-regress/ghci.debugger/scripts/break022/all.T b/testsuite/tests/ghc-regress/ghci.debugger/scripts/break022/all.T index b8b60a20f7..8bfdaf5e41 100644 --- a/testsuite/tests/ghc-regress/ghci.debugger/scripts/break022/all.T +++ b/testsuite/tests/ghc-regress/ghci.debugger/scripts/break022/all.T @@ -1,3 +1,3 @@ -setTestOpts(extra_run_opts('-ignore-dot-ghci')) +setTestOpts(extra_run_opts('-ignore-dot-ghci'), if_compiler_profiled(skip)) test('break022', normal, ghci_script, ['break022.script']) diff --git a/testsuite/tests/ghc-regress/ghci.debugger/scripts/break023/all.T b/testsuite/tests/ghc-regress/ghci.debugger/scripts/break023/all.T index cfd0990c1a..1a323329c1 100644 --- a/testsuite/tests/ghc-regress/ghci.debugger/scripts/break023/all.T +++ b/testsuite/tests/ghc-regress/ghci.debugger/scripts/break023/all.T @@ -1,3 +1,3 @@ -setTestOpts(extra_run_opts('-ignore-dot-ghci')) +setTestOpts(extra_run_opts('-ignore-dot-ghci'), if_compiler_profiled(skip)) test('break023', normal, ghci_script, ['break023.script']) diff --git a/testsuite/tests/ghc-regress/ghci/scripts/all.T b/testsuite/tests/ghc-regress/ghci/scripts/all.T index a2ca3d29a3..e97d830055 100644 --- a/testsuite/tests/ghc-regress/ghci/scripts/all.T +++ b/testsuite/tests/ghc-regress/ghci/scripts/all.T @@ -1,3 +1,6 @@ + +setTestOpts(if_compiler_profiled(skip)) + test('ghci001', normal, ghci_script, ['ghci001.script']) test('ghci002', normal, ghci_script, ['ghci002.script']) test('ghci003', normal, ghci_script, ['ghci003.script']) diff --git a/testsuite/tests/ghc-regress/th/2014/all.T b/testsuite/tests/ghc-regress/th/2014/all.T index 101cd92304..13138dff4e 100644 --- a/testsuite/tests/ghc-regress/th/2014/all.T +++ b/testsuite/tests/ghc-regress/th/2014/all.T @@ -1,3 +1,5 @@ +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']), diff --git a/testsuite/tests/ghc-regress/th/TH_import_loop/TH_import_loop.T b/testsuite/tests/ghc-regress/th/TH_import_loop/TH_import_loop.T index 7f4025115c..ebb8a427a7 100644 --- a/testsuite/tests/ghc-regress/th/TH_import_loop/TH_import_loop.T +++ b/testsuite/tests/ghc-regress/th/TH_import_loop/TH_import_loop.T @@ -1,3 +1,5 @@ +setTestOpts(if_compiler_profiled(skip)) + test('TH_import_loop', expect_broken(1012), multimod_compile_and_run, ['Main', '-v0']) diff --git a/testsuite/tests/ghc-regress/th/TH_recompile/all.T b/testsuite/tests/ghc-regress/th/TH_recompile/all.T index 6e1f8769e0..ecdba11c05 100644 --- a/testsuite/tests/ghc-regress/th/TH_recompile/all.T +++ b/testsuite/tests/ghc-regress/th/TH_recompile/all.T @@ -6,6 +6,7 @@ def f(opts): setTestOpts(f) setTestOpts(only_compiler_types(['ghc'])) setTestOpts(only_ways(['normal'])); +setTestOpts(if_compiler_profiled(skip)) test('TH_recompile', [expect_broken(481), diff --git a/testsuite/tests/ghc-regress/th/all.T b/testsuite/tests/ghc-regress/th/all.T index 42984cafac..77bc7db06a 100644 --- a/testsuite/tests/ghc-regress/th/all.T +++ b/testsuite/tests/ghc-regress/th/all.T @@ -6,6 +6,7 @@ def f(opts): setTestOpts(f) setTestOpts(only_compiler_types(['ghc'])) setTestOpts(only_ways(['normal','ghci'])) +setTestOpts(if_compiler_profiled(skip)) test('TH_mkName', normal, compile, ['-v0']) test('TH_1tuple', normal, compile_fail, ['-v0']) -- GitLab