[commit: ghc] master: Testsuite: make CLEANUP=1 the default (#9758) (c4259ff)

git at git.haskell.org git at git.haskell.org
Sat Apr 30 08:15:22 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c4259ff3defcac0d8f8075fd99884eef22e5d966/ghc

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

commit c4259ff3defcac0d8f8075fd99884eef22e5d966
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Tue Apr 26 15:12:05 2016 +0200

    Testsuite: make CLEANUP=1 the default (#9758)
    
    Also move the `cleanup` setting from `default_testopts` to `config`. The
    `cleanup` setting is the same for all tests, hence it belongs in
    `config`.
    
    Reviewed by: austin
    
    Differential Revision: https://phabricator.haskell.org/D2148


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

c4259ff3defcac0d8f8075fd99884eef22e5d966
 testsuite/config/ghc                   |  1 +
 testsuite/driver/testglobals.py        |  3 ---
 testsuite/driver/testlib.py            |  2 +-
 testsuite/mk/test.mk                   | 19 +++++++++++++------
 testsuite/tests/cabal/cabal01/all.T    |  4 ++--
 testsuite/tests/cabal/cabal03/all.T    |  4 ++--
 testsuite/tests/cabal/cabal04/all.T    |  4 ++--
 testsuite/tests/cabal/cabal05/all.T    |  4 ++--
 testsuite/tests/cabal/cabal06/all.T    |  4 ++--
 testsuite/tests/cabal/cabal08/all.T    |  4 ++--
 testsuite/tests/cabal/cabal09/all.T    |  4 ++--
 testsuite/tests/cabal/sigcabal01/all.T |  4 ++--
 12 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/testsuite/config/ghc b/testsuite/config/ghc
index 26ce3bd..595415a 100644
--- a/testsuite/config/ghc
+++ b/testsuite/config/ghc
@@ -81,6 +81,7 @@ if (ghc_with_llvm == 1):
     config.run_ways.append('optllvm')
 
 config.in_tree_compiler = in_tree_compiler
+config.cleanup          = cleanup
 config.clean_only       = clean_only
 
 config.way_flags = lambda name : {
diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py
index 2c7f551..d197692 100644
--- a/testsuite/driver/testglobals.py
+++ b/testsuite/driver/testglobals.py
@@ -207,9 +207,6 @@ class TestOptions:
        # expected exit code
        self.exit_code = 0
 
-       # should we clean up after ourselves?
-       self.cleanup = ''
-
        # extra files to clean afterward
        self.clean_files = []
 
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index c69c874..a722184 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -694,7 +694,7 @@ def test_common_work (name, opts, func, args):
                 if way not in do_ways:
                     skiptest (name,way)
 
-        if getTestOpts().cleanup != '' and (config.clean_only or do_ways != []):
+        if config.cleanup and (config.clean_only or do_ways):
             pretest_cleanup(name)
             clean([name + suff for suff in [
                        '', '.exe', '.exe.manifest', '.genscript',
diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk
index 6d9a4c2..8198efb 100644
--- a/testsuite/mk/test.mk
+++ b/testsuite/mk/test.mk
@@ -189,6 +189,14 @@ ifeq "$(SKIP_PERF_TESTS)" "YES"
 RUNTEST_OPTS += --skip-perf-tests
 endif
 
+ifeq "$(CLEANUP)" "0"
+RUNTEST_OPTS += -e cleanup=False
+else ifeq "$(CLEANUP)" "NO"
+RUNTEST_OPTS += -e cleanup=False
+else
+RUNTEST_OPTS += -e cleanup=True
+endif
+
 ifneq "$(CLEAN_ONLY)" ""
 RUNTEST_OPTS += -e clean_only=True
 else
@@ -207,7 +215,6 @@ RUNTEST_OPTS +=  \
 	-e 'config.os="$(TargetOS_CPP)"' \
 	-e 'config.arch="$(TargetARCH_CPP)"' \
 	-e 'config.wordsize="$(WORDSIZE)"' \
-	-e 'default_testopts.cleanup="$(CLEANUP)"' \
 	-e 'config.timeout=int($(TIMEOUT)) or config.timeout' \
 	-e 'config.exeext="$(exeext)"' \
 	-e 'config.top="$(TOP_ABS)"'
@@ -326,15 +333,15 @@ list_broken:
 # From
 # https://www.gnu.org/software/make/manual/html_node/Variables_002fRecursion.html:
 #
-#     "The ‘-j’ option is a special case (see Parallel Execution). If you set
-#     it to some numeric value ‘N’ and your operating system supports it (most
-#     any UNIX system will; others typically won’t), the parent make and all the
-#     sub-makes will communicate to ensure that there are only ‘N’ jobs running
+#     "The '-j' option is a special case (see Parallel Execution). If you set
+#     it to some numeric value 'N' and your operating system supports it (most
+#     any UNIX system will; others typically won't), the parent make and all the
+#     sub-makes will communicate to ensure that there are only 'N' jobs running
 #     at the same time between them all."
 #
 # In our scenario, the user will actually see the following warning [2]:
 #
-#     ‘warning: jobserver unavailable: using -j1. Add `+' to parent make rule.’
+#     'warning: jobserver unavailable: using -j1. Add '+' to parent make rule.'
 #
 # The problem is that topmake and submake don't know about eachother, since
 # python is in between. To let them communicate, we have to use the '+'
diff --git a/testsuite/tests/cabal/cabal01/all.T b/testsuite/tests/cabal/cabal01/all.T
index 5149805..43485ea 100644
--- a/testsuite/tests/cabal/cabal01/all.T
+++ b/testsuite/tests/cabal/cabal01/all.T
@@ -13,10 +13,10 @@ if config.have_shared_libs:
 else:
     dyn = '--disable-shared'
 
-if default_testopts.cleanup != '':
+if config.cleanup:
    cleanup = 'CLEANUP=1'
 else:
-   cleanup = ''
+   cleanup = 'CLEANUP=0'
 
 def ignoreLdOutput(str):
     return re.sub('Creating library file: dist.build.libHStest-1.0-ghc[0-9.]*.dll.a\n', '', str)
diff --git a/testsuite/tests/cabal/cabal03/all.T b/testsuite/tests/cabal/cabal03/all.T
index 01d3882..b1b0561 100644
--- a/testsuite/tests/cabal/cabal03/all.T
+++ b/testsuite/tests/cabal/cabal03/all.T
@@ -1,7 +1,7 @@
-if default_testopts.cleanup != '':
+if config.cleanup:
    cleanup = 'CLEANUP=1'
 else:
-   cleanup = ''
+   cleanup = 'CLEANUP=0'
 
 test('cabal03',
      ignore_output,
diff --git a/testsuite/tests/cabal/cabal04/all.T b/testsuite/tests/cabal/cabal04/all.T
index b2794a5..e69b540 100644
--- a/testsuite/tests/cabal/cabal04/all.T
+++ b/testsuite/tests/cabal/cabal04/all.T
@@ -13,10 +13,10 @@ if not config.compiler_profiled and config.have_shared_libs:
 else:
     dyn = '--disable-shared'
 
-if default_testopts.cleanup != '':
+if config.cleanup:
    cleanup = 'CLEANUP=1'
 else:
-   cleanup = ''
+   cleanup = 'CLEANUP=0'
 
 test('cabal04',
      normal,
diff --git a/testsuite/tests/cabal/cabal05/all.T b/testsuite/tests/cabal/cabal05/all.T
index 36dcbdf..d7d9ffb 100644
--- a/testsuite/tests/cabal/cabal05/all.T
+++ b/testsuite/tests/cabal/cabal05/all.T
@@ -1,7 +1,7 @@
-if default_testopts.cleanup != '':
+if config.cleanup:
    cleanup = 'CLEANUP=1'
 else:
-   cleanup = ''
+   cleanup = 'CLEANUP=0'
 
 test('cabal05',
      ignore_output,
diff --git a/testsuite/tests/cabal/cabal06/all.T b/testsuite/tests/cabal/cabal06/all.T
index edca288..6568e07 100644
--- a/testsuite/tests/cabal/cabal06/all.T
+++ b/testsuite/tests/cabal/cabal06/all.T
@@ -1,7 +1,7 @@
-if default_testopts.cleanup != '':
+if config.cleanup:
    cleanup = 'CLEANUP=1'
 else:
-   cleanup = ''
+   cleanup = 'CLEANUP=0'
 
 test('cabal06',
      normal,
diff --git a/testsuite/tests/cabal/cabal08/all.T b/testsuite/tests/cabal/cabal08/all.T
index fc4221a..3aaf185 100644
--- a/testsuite/tests/cabal/cabal08/all.T
+++ b/testsuite/tests/cabal/cabal08/all.T
@@ -1,7 +1,7 @@
-if default_testopts.cleanup != '':
+if config.cleanup:
    cleanup = 'CLEANUP=1'
 else:
-   cleanup = ''
+   cleanup = 'CLEANUP=0'
 
 test('cabal08',
      normal,
diff --git a/testsuite/tests/cabal/cabal09/all.T b/testsuite/tests/cabal/cabal09/all.T
index 66bdb01..6728c77 100644
--- a/testsuite/tests/cabal/cabal09/all.T
+++ b/testsuite/tests/cabal/cabal09/all.T
@@ -1,7 +1,7 @@
-if default_testopts.cleanup != '':
+if config.cleanup:
    cleanup = 'CLEANUP=1'
 else:
-   cleanup = ''
+   cleanup = 'CLEANUP=0'
 
 test('cabal09',
      ignore_output,
diff --git a/testsuite/tests/cabal/sigcabal01/all.T b/testsuite/tests/cabal/sigcabal01/all.T
index 24c50b6..4a1bad9 100644
--- a/testsuite/tests/cabal/sigcabal01/all.T
+++ b/testsuite/tests/cabal/sigcabal01/all.T
@@ -1,7 +1,7 @@
-if default_testopts.cleanup != '':
+if config.cleanup:
    cleanup = 'CLEANUP=1'
 else:
-   cleanup = ''
+   cleanup = 'CLEANUP=0'
 
 test('sigcabal01',
      expect_broken(10622),



More information about the ghc-commits mailing list