From: Eli Bendersky Date: Tue, 6 Mar 2018 20:07:15 +0000 (-0800) Subject: Add timings for steps of execution in running these tests X-Git-Tag: v0.25~5^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aebea935b9326043a27d6bf1534c841e43407bd7;p=pyelftools.git Add timings for steps of execution in running these tests --- diff --git a/test/run_readelf_tests.py b/test/run_readelf_tests.py index 54561b6..9620810 100755 --- a/test/run_readelf_tests.py +++ b/test/run_readelf_tests.py @@ -8,11 +8,13 @@ # This code is in the public domain #------------------------------------------------------------------------------- import argparse -import os, sys, platform +import os +import sys import re from difflib import SequenceMatcher import logging import platform +import time from utils import run_exe, is_in_rootdir, dump_output_to_temp_files # Make it possible to run this file from the root dir of pyelftools without @@ -72,13 +74,17 @@ def run_test_on_file(filename, verbose=False): args = [option, filename] if verbose: testlog.info("....executing: '%s %s'" % ( exe_path, ' '.join(args))) + t1 = time.time() rc, stdout = run_exe(exe_path, args) + testlog.info("....elapsed: %s" % (time.time() - t1,)) if rc != 0: testlog.error("@@ aborting - '%s' returned '%s'" % (exe_path, rc)) return False stdouts.append(stdout) if verbose: testlog.info('....comparing output...') + t1 = time.time() rc, errmsg = compare_output(*stdouts) + testlog.info("....elapsed: %s" % (time.time() - t1,)) if rc: if verbose: testlog.info('.......................SUCCESS') else: