26
26
import tempfile
27
27
import re
28
28
import logging
29
- import unittest
30
29
31
30
os .environ ["REQUIRE_WALLET_TYPE_SET" ] = "1"
32
31
70
69
TEST_EXIT_PASSED = 0
71
70
TEST_EXIT_SKIPPED = 77
72
71
73
- # List of framework modules containing unit tests. Should be kept in sync with
74
- # the output of `git grep unittest.TestCase ./test/functional/test_framework`
75
- TEST_FRAMEWORK_MODULES = [
76
- "address" ,
77
- "crypto.bip324_cipher" ,
78
- "blocktools" ,
79
- "crypto.chacha20" ,
80
- "crypto.ellswift" ,
81
- "key" ,
82
- "messages" ,
83
- "crypto.muhash" ,
84
- "crypto.poly1305" ,
85
- "crypto.ripemd160" ,
86
- "script" ,
87
- "segwit_addr" ,
88
- "wallet_util" ,
89
- ]
72
+ TEST_FRAMEWORK_UNIT_TESTS = 'feature_framework_unit_tests.py'
90
73
91
74
EXTENDED_SCRIPTS = [
92
75
# These tests are not run by default.
255
238
'wallet_keypool.py --descriptors' ,
256
239
'wallet_descriptor.py --descriptors' ,
257
240
'p2p_nobloomfilter_messages.py' ,
241
+ TEST_FRAMEWORK_UNIT_TESTS ,
258
242
'p2p_filter.py' ,
259
243
'rpc_setban.py --v1transport' ,
260
244
'rpc_setban.py --v2transport' ,
@@ -440,7 +424,6 @@ def main():
440
424
parser .add_argument ('--tmpdirprefix' , '-t' , default = tempfile .gettempdir (), help = "Root directory for datadirs" )
441
425
parser .add_argument ('--failfast' , '-F' , action = 'store_true' , help = 'stop execution after the first test failure' )
442
426
parser .add_argument ('--filter' , help = 'filter scripts to run by regular expression' )
443
- parser .add_argument ('--skipunit' , '-u' , action = 'store_true' , help = 'skip unit tests for the test framework' )
444
427
445
428
446
429
args , unknown_args = parser .parse_known_args ()
@@ -552,10 +535,9 @@ def main():
552
535
combined_logs_len = args .combinedlogslen ,
553
536
failfast = args .failfast ,
554
537
use_term_control = args .ansi ,
555
- skipunit = args .skipunit ,
556
538
)
557
539
558
- def run_tests (* , test_list , src_dir , build_dir , tmpdir , jobs = 1 , enable_coverage = False , args = None , combined_logs_len = 0 , failfast = False , use_term_control , skipunit = False ):
540
+ def run_tests (* , test_list , src_dir , build_dir , tmpdir , jobs = 1 , enable_coverage = False , args = None , combined_logs_len = 0 , failfast = False , use_term_control ):
559
541
args = args or []
560
542
561
543
# Warn if bitcoind is already running
@@ -578,15 +560,6 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=
578
560
# a hard link or a copy on any platform. See https://github.com/bitcoin/bitcoin/pull/27561.
579
561
sys .path .append (tests_dir )
580
562
581
- if not skipunit :
582
- print ("Running Unit Tests for Test Framework Modules" )
583
- test_framework_tests = unittest .TestSuite ()
584
- for module in TEST_FRAMEWORK_MODULES :
585
- test_framework_tests .addTest (unittest .TestLoader ().loadTestsFromName ("test_framework.{}" .format (module )))
586
- result = unittest .TextTestRunner (verbosity = 1 , failfast = True ).run (test_framework_tests )
587
- if not result .wasSuccessful ():
588
- sys .exit ("Early exiting after failure in TestFramework unit tests" )
589
-
590
563
flags = ['--cachedir={}' .format (cache_dir )] + args
591
564
592
565
if enable_coverage :
0 commit comments