Index: test/dosep.py =================================================================== --- test/dosep.py +++ test/dosep.py @@ -66,6 +66,23 @@ # Status codes for running command with timeout. eTimedOut, ePassed, eFailed = 124, 0, 1 +tests_total = 0 +output_lock = multiprocessing.Lock() +tests_processed = multiprocessing.Value('i', 0) + +def update_status(name = None, output = None): + output_lock.acquire() + global tests_processed + if output is not None: + print >> sys.stderr + print >> sys.stderr, 'Test suite %s failed' % name + print >> sys.stderr, 'stdout:\n' + output[0] + print >> sys.stderr, 'stderr:\n' + output[0] + sys.stderr.write("\r%*d out of %d test suites processed" % + (len(str(tests_total)), tests_processed.value, tests_total)) + tests_processed.value += 1 + output_lock.release(); + def parse_test_results(output): passes = 0 failures = 0 @@ -84,7 +101,7 @@ pass return passes, failures -def call_with_timeout(command, timeout): +def call_with_timeout(command, timeout, name): """Run command with a timeout if possible.""" """-s QUIT will create a coredump if they are enabled on your system""" process = None @@ -103,6 +120,7 @@ output = process.communicate() exit_status = process.returncode passes, failures = parse_test_results(output) + update_status(name, output if failures > 0 else None) return exit_status, passes, failures def process_dir(root, files, test_root, dotest_argv): @@ -132,7 +150,7 @@ timeout = os.getenv("LLDB_%s_TIMEOUT" % timeout_name) or default_timeout - exit_status, pass_count, fail_count = call_with_timeout(command, timeout) + exit_status, pass_count, fail_count = call_with_timeout(command, timeout, name) pass_sub_count = pass_sub_count + pass_count fail_sub_count = fail_sub_count + fail_count @@ -169,6 +187,11 @@ for root, dirs, files in os.walk(test_subdir, topdown=False): test_work_items.append((root, files, test_directory, dotest_argv)) + global tests_total + tests_total = len(test_work_items) + print >> sys.stderr, "Testing: %d tests, %d threads" % (tests_total, num_threads) + update_status() + # Run the items, either in a pool (for multicore speedup) or # calling each individually. if num_threads > 1: @@ -355,6 +378,7 @@ test_name = os.path.splitext(xtime)[0] touch(os.path.join(session_dir, "{}-{}".format(result, test_name))) + print print "Ran %d test suites (%d failed) (%f%%)" % (num_test_files, len(failed), 100.0*len(failed)/num_test_files) print "Ran %d test cases (%d failed) (%f%%)" % (num_tests, all_fails, 100.0*all_fails/num_tests) if len(failed) > 0: