summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2022-10-26 10:34:34 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2022-10-26 10:34:34 -0700
commitde04bf85a087d2c914b30aaa4e3d563e53b06454 (patch)
treeeaae2ba44afda96c1704f252ec090453ea9f1271 /testing
parenteded27097384dfa54172f955e0a3ab7ccdb187bf (diff)
downloadscons-git-de04bf85a087d2c914b30aaa4e3d563e53b06454.tar.gz
Fixed taskmaster trace tests. Previously there was an extra line at the end of the file. It's no longer there. Added TestCommon.detailed_diff() function which can be used to diff large text blobs expected vs actual
Diffstat (limited to 'testing')
-rw-r--r--testing/framework/TestCommon.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/framework/TestCommon.py b/testing/framework/TestCommon.py
index f45b856e3..df005b341 100644
--- a/testing/framework/TestCommon.py
+++ b/testing/framework/TestCommon.py
@@ -796,6 +796,22 @@ class TestCommon(TestCmd):
# so this is an Aegis invocation; pass the test (exit 0).
self.pass_test()
+ @staticmethod
+ def detailed_diff(value, expect):
+ v_split = value.split('\n')
+ e_split = expect.split('\n')
+ if len(v_split) != len(e_split):
+ print("different number of lines:%d %d" % (len(v_split), len(e_split)))
+
+ # breakpoint()
+ for v, e in zip(v_split, e_split):
+ # print("%s:%s"%(v,e))
+ if v != e:
+ print("\n[%s]\n[%s]" % (v, e))
+
+ return "Expected:\n%s\nGot:\n%s" % (expect, value)
+
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil