22
22
"""
23
23
24
24
import os
25
+ import time
25
26
import shutil
26
27
import sys
27
28
import subprocess
47
48
passOn = ""
48
49
p = re .compile ("^--" )
49
50
51
+ bold = ("" ,"" )
52
+ if (os .name == 'posix' ):
53
+ bold = ('\033 [0m' , '\033 [1m' )
54
+
50
55
for arg in sys .argv [1 :]:
51
56
if arg == '--coverage' :
52
57
ENABLE_COVERAGE = 1
92
97
'blockchain.py' ,
93
98
'disablewallet.py' ,
94
99
'sendheaders.py' ,
100
+ 'keypool.py' ,
95
101
]
96
102
testScriptsExt = [
97
103
'bip65-cltv.py' ,
105
111
'pruning.py' ,
106
112
'forknotify.py' ,
107
113
'invalidateblock.py' ,
108
- 'keypool.py' ,
109
114
# 'rpcbind_test.py', #temporary, bug in libevent, see #6655
110
115
'smartfees.py' ,
111
116
'maxblocksinflight.py' ,
@@ -126,7 +131,7 @@ def runtests():
126
131
127
132
if ENABLE_COVERAGE :
128
133
coverage = RPCCoverage ()
129
- print ("Initializing coverage directory at %s" % coverage .dir )
134
+ print ("Initializing coverage directory at %s\n " % coverage .dir )
130
135
131
136
if (ENABLE_WALLET == 1 and ENABLE_UTILS == 1 and ENABLE_BITCOIND == 1 ):
132
137
rpcTestDir = buildDir + '/qa/rpc-tests/'
@@ -141,10 +146,12 @@ def runtests():
141
146
or run_extended
142
147
or testScripts [i ] in opts
143
148
or re .sub (".py$" , "" , testScripts [i ]) in opts ):
144
- print ("Running testscript " + testScripts [i ] + "..." )
145
149
150
+ print ("Running testscript %s%s%s ..." % (bold [1 ], testScripts [i ], bold [0 ]))
151
+ time0 = time .time ()
146
152
subprocess .check_call (
147
153
rpcTestDir + testScripts [i ] + flags , shell = True )
154
+ print ("Duration: %s s\n " % (int (time .time () - time0 )))
148
155
149
156
# exit if help is called so we print just one set of
150
157
# instructions
@@ -156,12 +163,14 @@ def runtests():
156
163
for i in range (len (testScriptsExt )):
157
164
if (run_extended or testScriptsExt [i ] in opts
158
165
or re .sub (".py$" , "" , testScriptsExt [i ]) in opts ):
166
+
159
167
print (
160
168
"Running 2nd level testscript "
161
- + testScriptsExt [ i ] + " ..." )
162
-
169
+ + "%s%s%s ..." % ( bold [ 1 ], testScriptsExt [ i ], bold [ 0 ]) )
170
+ time0 = time . time ()
163
171
subprocess .check_call (
164
172
rpcTestDir + testScriptsExt [i ] + flags , shell = True )
173
+ print ("Duration: %s s\n " % (int (time .time () - time0 )))
165
174
166
175
if coverage :
167
176
coverage .report_rpc_coverage ()
0 commit comments