diff options
author | David Robillard <d@drobilla.net> | 2019-04-13 11:40:37 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-04-13 11:40:37 +0200 |
commit | 87bd186ede49ae3a7e8402b148f1bd26344ce4db (patch) | |
tree | d4f6f9baccc250e5b9c1883a9e92561b799a488e /waflib/extras | |
parent | dc15972a98d7b60bd81f9a6b456ecccaeb7c654d (diff) | |
parent | e3999d33c0347ca000fdafc2e9169701a9d69e0f (diff) | |
download | ganv-87bd186ede49ae3a7e8402b148f1bd26344ce4db.tar.gz ganv-87bd186ede49ae3a7e8402b148f1bd26344ce4db.tar.bz2 ganv-87bd186ede49ae3a7e8402b148f1bd26344ce4db.zip |
Update autowaf
Diffstat (limited to 'waflib/extras')
-rw-r--r-- | waflib/extras/autowaf.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/waflib/extras/autowaf.py b/waflib/extras/autowaf.py index 51077d1..d779967 100644 --- a/waflib/extras/autowaf.py +++ b/waflib/extras/autowaf.py @@ -807,11 +807,15 @@ def show_diff(from_lines, to_lines, from_filename, to_filename): import difflib import sys + same = True for line in difflib.unified_diff( from_lines, to_lines, fromfile=os.path.abspath(from_filename), tofile=os.path.abspath(to_filename)): sys.stderr.write(line) + same = False + + return same def test_file_equals(patha, pathb): import filecmp @@ -827,9 +831,7 @@ def test_file_equals(patha, pathb): with io.open(patha, 'rU', encoding='utf-8') as fa: with io.open(pathb, 'rU', encoding='utf-8') as fb: - show_diff(fa.readlines(), fb.readlines(), patha, pathb) - - return False + return show_diff(fa.readlines(), fb.readlines(), patha, pathb) def bench_time(): if hasattr(time, 'perf_counter'): # Added in Python 3.3 @@ -888,9 +890,10 @@ class TestScope: if 'stderr' in kwargs and kwargs['stderr'] == NONEMPTY: # Run with a temp file for stderr and check that it is non-empty import tempfile - with tempfile.TemporaryFile(mode='w') as stderr: + with tempfile.TemporaryFile() as stderr: kwargs['stderr'] = stderr output = self.run(test, **kwargs) + stderr.seek(0, 2) # Seek to end return (output if not output else self.run( lambda: stderr.tell() > 0, |