aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-10-09 09:18:42 -0400
committerJohn Newbery <john@johnnewbery.com>2017-10-09 10:03:17 -0400
commit7481579131e3a330300d2c7f9a8f93aa67be33e1 (patch)
tree7478727508f5de8efd61dfdfe4d080528d80b817
parent17f2acedbe078f179556f4550eca547726f087e1 (diff)
downloadbitcoin-7481579131e3a330300d2c7f9a8f93aa67be33e1.tar.xz
[tests] Make comp test framework more debuggable
Add logging so that each test prints the line number of the yield statement that generated the test.
-rwxr-xr-xtest/functional/test_framework/comptool.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/functional/test_framework/comptool.py b/test/functional/test_framework/comptool.py
index bfbc0c3b03..7047cb2c57 100755
--- a/test/functional/test_framework/comptool.py
+++ b/test/functional/test_framework/comptool.py
@@ -295,8 +295,11 @@ class TestManager(object):
# Wait until verack is received
self.wait_for_verack()
- test_number = 1
- for test_instance in self.test_generator.get_tests():
+ test_number = 0
+ tests = self.test_generator.get_tests()
+ for test_instance in tests:
+ test_number += 1
+ logger.info("Running test %d: %s line %s" % (test_number, tests.gi_code.co_filename, tests.gi_frame.f_lineno))
# We use these variables to keep track of the last block
# and last transaction in the tests, which are used
# if we're not syncing on every block or every tx.
@@ -397,9 +400,6 @@ class TestManager(object):
if (not self.check_mempool(tx.sha256, tx_outcome)):
raise AssertionError("Mempool test failed at test %d" % test_number)
- logger.info("Test %d: PASS" % test_number)
- test_number += 1
-
[ c.disconnect_node() for c in self.connections ]
self.wait_for_disconnections()
self.block_store.close()