[commit: ghc] master: Don't `make accept` output of expect_broken tests (d4cf705)

git at git.haskell.org git at git.haskell.org
Wed Apr 1 17:21:15 UTC 2015


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

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

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

commit d4cf7051bc17182238b17ba1dc42e190fa5c6f0d
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Wed Apr 1 17:28:39 2015 +0200

    Don't `make accept` output of expect_broken tests
    
    When running `make accept` on a directory in the testsuite, don't accept
    the output of tests that are marked as expect_broken. This makes it
    easier to review `git diff` after running `make accept`.
    
    When you change an error message in the compiler that shows up in the
    output of many tests, you can run `make accept` in the testsuite
    directory, and all expected test output will be updated. But since your
    change didn't magically fix all the other bugs in the compiler for which
    we have an expect_broken test, the output for those tests should
    probably not be updated.
    
    Before, the effect of running `make accept` could be that some tests
    would end up in the 'unexpected passes' group.
    
    [skip ci]
    
    Reviewed By: austin
    
    Differential Revision: https://phabricator.haskell.org/D781


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

d4cf7051bc17182238b17ba1dc42e190fa5c6f0d
 testsuite/driver/testlib.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index e178f2a..b4c64ca 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -1671,7 +1671,10 @@ def compare_outputs( kind, normaliser, expected_file, actual_file ):
                 r = os.system( 'diff -u ' + expected_file_for_diff + \
                                       ' ' + actual_file )
 
-        if config.accept:
+        if config.accept and getTestOpts().expect == 'fail':
+            if_verbose(1, 'Test is expected to fail. Not accepting new output.')
+            return 0
+        elif config.accept:
             if_verbose(1, 'Accepting new output.')
             write_file(expected_file, actual_raw)
             return 1



More information about the ghc-commits mailing list