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
93
98
'blockchain.py' ,
94
99
'disablewallet.py' ,
95
100
'sendheaders.py' ,
101
+ 'keypool.py' ,
96
102
]
97
103
testScriptsExt = [
98
104
'bip65-cltv.py' ,
106
112
'pruning.py' ,
107
113
'forknotify.py' ,
108
114
'invalidateblock.py' ,
109
- 'keypool.py' ,
110
115
# 'rpcbind_test.py', #temporary, bug in libevent, see #6655
111
116
'smartfees.py' ,
112
117
'maxblocksinflight.py' ,
@@ -127,7 +132,7 @@ def runtests():
127
132
128
133
if ENABLE_COVERAGE :
129
134
coverage = RPCCoverage ()
130
- print ("Initializing coverage directory at %s" % coverage .dir )
135
+ print ("Initializing coverage directory at %s\n " % coverage .dir )
131
136
132
137
if (ENABLE_WALLET == 1 and ENABLE_UTILS == 1 and ENABLE_BITCOIND == 1 ):
133
138
rpcTestDir = buildDir + '/qa/rpc-tests/'
@@ -142,10 +147,12 @@ def runtests():
142
147
or run_extended
143
148
or testScripts [i ] in opts
144
149
or re .sub (".py$" , "" , testScripts [i ]) in opts ):
145
- print ("Running testscript " + testScripts [i ] + "..." )
146
150
151
+ print ("Running testscript %s%s%s ..." % (bold [1 ], testScripts [i ], bold [0 ]))
152
+ time0 = time .time ()
147
153
subprocess .check_call (
148
154
rpcTestDir + testScripts [i ] + flags , shell = True )
155
+ print ("Duration: %s s\n " % (int (time .time () - time0 )))
149
156
150
157
# exit if help is called so we print just one set of
151
158
# instructions
@@ -157,12 +164,14 @@ def runtests():
157
164
for i in range (len (testScriptsExt )):
158
165
if (run_extended or testScriptsExt [i ] in opts
159
166
or re .sub (".py$" , "" , testScriptsExt [i ]) in opts ):
167
+
160
168
print (
161
169
"Running 2nd level testscript "
162
- + testScriptsExt [ i ] + " ..." )
163
-
170
+ + "%s%s%s ..." % ( bold [ 1 ], testScriptsExt [ i ], bold [ 0 ]) )
171
+ time0 = time . time ()
164
172
subprocess .check_call (
165
173
rpcTestDir + testScriptsExt [i ] + flags , shell = True )
174
+ print ("Duration: %s s\n " % (int (time .time () - time0 )))
166
175
167
176
if coverage :
168
177
coverage .report_rpc_coverage ()
0 commit comments