verify.py (13056:f483df6334a5) verify.py (13100:fc7df026c235)
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 ]
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()
145 def run_test(test):
146 cmd = []
147 if args.timeout:
148 cmd.extend(timeout_cmd)
149 cmd.extend([
150 test.full_path(),
146 def run_test(test):
147 cmd = []
148 if args.timeout:
149 cmd.extend(timeout_cmd)
150 cmd.extend([
151 test.full_path(),
151 '-red', test.m5out_dir(),
152 '-red', os.path.abspath(test.m5out_dir()),
152 '--listener-mode=off',
153 '--quiet',
153 '--listener-mode=off',
154 '--quiet',
154 config_path
155 config_path,
156 '--working-dir',
157 os.path.dirname(test.src_dir())
155 ])
156 # Ensure the output directory exists.
157 if not os.path.exists(test.m5out_dir()):
158 os.makedirs(test.m5out_dir())
159 try:
160 subprocess.check_call(cmd)
161 except subprocess.CalledProcessError, error:
162 returncode = error.returncode
163 else:
164 returncode = 0
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)
165 with open(test.returncode_file(), 'w') as rc:
166 rc.write('%d\n' % returncode)
167
168 runnable = filter(lambda t: not t.compile_only, tests)
169 if args.j == 1:
170 map(run_test, runnable)
171 else:
172 tp = multiprocessing.pool.ThreadPool(args.j)

--- 352 unchanged lines hidden ---
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 ---