Index: test/dosep.py =================================================================== --- test/dosep.py +++ test/dosep.py @@ -59,13 +59,13 @@ """Run command with a timeout if possible.""" if os.name != "nt": if timeout_command and timeout != "0": - return subprocess.call([timeout_command, timeout] + command, + return subprocess.call([timeout_command, '-s', 'QUIT', timeout] + command, stdin=subprocess.PIPE, close_fds=True) return (ePassed if subprocess.call(command, stdin=subprocess.PIPE, close_fds=True) == 0 else eFailed) else: if timeout_command and timeout != "0": - return subprocess.call([timeout_command, timeout] + command, + return subprocess.call([timeout_command, '-s', 'QUIT', timeout] + command, stdin=subprocess.PIPE) return (ePassed if subprocess.call(command, stdin=subprocess.PIPE) == 0 else eFailed) @@ -193,6 +193,15 @@ with open(fname, 'a'): os.utime(fname, times) +import os, fnmatch +def find(pattern, path): + result = [] + for root, dirs, files in os.walk(path): + for name in files: + if fnmatch.fnmatch(name, pattern): + result.append(os.path.join(root, name)) + return result + def main(): # We can't use sys.path[0] to determine the script directory # because it doesn't work under a debugger @@ -251,6 +260,11 @@ else: test_subdir = os.path.join(test_directory, args[0]) + # clean core files from previous runs + cores = find('core.*', test_subdir) + for core in cores: + os.unlink(core) + if opts.num_threads: num_threads = opts.num_threads else: @@ -268,6 +282,13 @@ timed_out = set(timed_out) num_tests = len(failed) + len(passed) + # move core files into session dir + cores = find('core.*', test_subdir) + for core in cores: + dst = core.replace(test_directory, "")[1:] + dst = dst.replace(os.path.sep, "-") + os.rename(core, os.path.join(session_dir, dst)) + # remove expected timeouts from failures expected_timeout = getExpectedTimeouts(dotest_options.lldb_platform_name) for xtime in expected_timeout: