aboutsummaryrefslogtreecommitdiff
path: root/meson_test.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-03-23 01:09:39 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-03-23 01:09:39 +0200
commita7b5d30dccbfad7a61912652a865faec90c453d9 (patch)
treec749f25abe0bee7b949374d05bb442f82f4b1983 /meson_test.py
parent33aaae5cf05e330e15c1f81239c2ba40f06955a3 (diff)
downloadmeson-a7b5d30dccbfad7a61912652a865faec90c453d9.zip
meson-a7b5d30dccbfad7a61912652a865faec90c453d9.tar.gz
meson-a7b5d30dccbfad7a61912652a865faec90c453d9.tar.bz2
Measure time spent in tests.
Diffstat (limited to 'meson_test.py')
-rwxr-xr-xmeson_test.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/meson_test.py b/meson_test.py
index bbe3b12..fc22a67 100755
--- a/meson_test.py
+++ b/meson_test.py
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import sys, subprocess
+import sys, subprocess, time
from optparse import OptionParser
parser = OptionParser()
@@ -44,15 +44,18 @@ def run_tests(options, datafilename):
if line == '':
continue
cmd = wrap + [line]
+ starttime = time.time()
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdo, stde) = p.communicate()
+ endtime = time.time()
+ duration = endtime - starttime
stdo = stdo.decode()
stde = stde.decode()
if p.returncode != 0:
- result_str = 'Test "%s": FAIL' % line
+ result_str = 'Test "%s": FAIL (%.3f s)' % (line, duration)
else:
- result_str = 'Test "%s": OK' % line
+ result_str = 'Test "%s": OK (%.3f s)' % (line, duration)
print(result_str)
write_log(logfile, line, result_str, stdo, stde)
print('\nFull log written to %s.' % logfilename)