Deleted Added
sdiff udiff text old ( 13056:f483df6334a5 ) new ( 13100:fc7df026c235 )
full compact
1#!/usr/bin/env python2
2#
3# Copyright 2018 Google, Inc.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 128 unchanged lines hidden (view full) ---

137 help='How many tests to run in parallel.')
138 args = parser.parse_args(self.args)
139
140 timeout_cmd = [
141 'timeout',
142 '--kill-after', str(args.timeout * 2),
143 str(args.timeout)
144 ]
145 curdir = os.getcwd()
146 def run_test(test):
147 cmd = []
148 if args.timeout:
149 cmd.extend(timeout_cmd)
150 cmd.extend([
151 test.full_path(),
152 '-red', os.path.abspath(test.m5out_dir()),
153 '--listener-mode=off',
154 '--quiet',
155 config_path,
156 '--working-dir',
157 os.path.dirname(test.src_dir())
158 ])
159 # Ensure the output directory exists.
160 if not os.path.exists(test.m5out_dir()):
161 os.makedirs(test.m5out_dir())
162 try:
163 subprocess.check_call(cmd)
164 except subprocess.CalledProcessError, error:
165 returncode = error.returncode
166 else:
167 returncode = 0
168 os.chdir(curdir)
169 with open(test.returncode_file(), 'w') as rc:
170 rc.write('%d\n' % returncode)
171
172 runnable = filter(lambda t: not t.compile_only, tests)
173 if args.j == 1:
174 map(run_test, runnable)
175 else:
176 tp = multiprocessing.pool.ThreadPool(args.j)

--- 352 unchanged lines hidden ---