[commit: testsuite] wip/T8413: Flag to test suite: SKIP_PERF_TESTS (7d29fbf)

git at git.haskell.org git
Sat Oct 5 15:07:59 UTC 2013


Repository : ssh://git at git.haskell.org/testsuite

On branch  : wip/T8413
Link       : http://ghc.haskell.org/trac/ghc/changeset/7d29fbf373befbc0ee60dff01f6a9cabee047862/testsuite

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

commit 7d29fbf373befbc0ee60dff01f6a9cabee047862
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Sat Oct 5 17:04:31 2013 +0200

    Flag to test suite: SKIP_PERF_TESTS
    
    More often than not the output of the performance tests is in the way,
    rather than helping. This allows the use of `make SKIP_PERF_TESTS=YES`
    to skip these tests. Fixes #8413


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

7d29fbf373befbc0ee60dff01f6a9cabee047862
 README.md             |    1 +
 driver/runtests.py    |    4 ++++
 driver/testglobals.py |    3 +++
 driver/testlib.py     |    6 ++++++
 mk/test.mk            |    4 ++++
 5 files changed, 18 insertions(+)

diff --git a/README.md b/README.md
index 7620809..f934533 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,7 @@ Commands to run testsuite:
  * Run a specific test: `make TEST=tc054`
  * Test a specific 'way': `make WAY=optllvm`
  * Test a specifc stage of GHC: `make stage=1`
+ * Skip performance tests: `make SKIP_PERF_TESTS=YES`
  * Set verbosity: `make VERBOSE=n`
    where n=0: No per-test ouput, n=1: Only failures,
          n=2: Progress output, n=3: Include commands called (default)
diff --git a/driver/runtests.py b/driver/runtests.py
index b0367f3..8ed6499 100644
--- a/driver/runtests.py
+++ b/driver/runtests.py
@@ -45,6 +45,7 @@ long_options = [
   "threads=",           # threads to run simultaneously
   "check-files-written", # check files aren't written by multiple tests
   "verbose=",          # verbose (0,1,2 so far)
+  "skip-perf-tests",       # skip performance tests
   ]
 
 opts, args = getopt.getopt(sys.argv[1:], "e:", long_options)
@@ -93,6 +94,9 @@ for opt,arg in opts:
     if opt == '--check-files-written':
         config.check_files_written = True
 
+    if opt == '--skip-perf-tests':
+        config.skip_perf_tests = True
+
     if opt == '--verbose':
         if arg not in ["0","1","2","3"]:
             sys.stderr.write("ERROR: requested verbosity %s not supported, use 0,1,2 or 3" % arg)
diff --git a/driver/testglobals.py b/driver/testglobals.py
index 85a5b7d..203d85f 100644
--- a/driver/testglobals.py
+++ b/driver/testglobals.py
@@ -112,6 +112,9 @@ class TestConfig:
         # Should we check for files being written more than once?
         self.check_files_written = False
 
+        # Should we skip performance tests
+        self.skip_perf_tests = False
+
 global config
 config = TestConfig()
 
diff --git a/driver/testlib.py b/driver/testlib.py
index 4694b5e..ed7d02f 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -60,6 +60,11 @@ def setLocalTestOpts(opts):
     global testopts_local
     testopts_local.x=opts
 
+def isStatsTest():
+    opts = getTestOpts()
+    return len(opts.compiler_stats_range_fields) > 0 or len(opts.stats_range_fields) > 0
+
+
 # This can be called at the top of a file of tests, to set default test options
 # for the following tests.
 def setTestOpts( f ):
@@ -606,6 +611,7 @@ def test_common_work (name, opts, func, args):
             and (config.only == [] or name in config.only) \
             and (getTestOpts().only_ways == None or way in getTestOpts().only_ways) \
             and (config.cmdline_ways == [] or way in config.cmdline_ways) \
+            and (not (config.skip_perf_tests and isStatsTest())) \
             and way not in getTestOpts().omit_ways
 
         # Which ways we are asked to skip
diff --git a/mk/test.mk b/mk/test.mk
index 928e1e4..0cc3f21 100644
--- a/mk/test.mk
+++ b/mk/test.mk
@@ -163,6 +163,10 @@ ifneq "$(VERBOSE)" ""
 RUNTEST_OPTS += --verbose=$(VERBOSE)
 endif
 
+ifeq "$(SKIP_PERF_TESTS)" "YES"
+RUNTEST_OPTS += --skip-perf-tests
+endif
+
 ifneq "$(CLEAN_ONLY)" ""
 RUNTEST_OPTS += -e clean_only=True
 else




More information about the ghc-commits mailing list