SConscript (4937:04ace9ab855e) SConscript (5525:abb8846b2e62)
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2006 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

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

173 ref_stats = os.path.join(ref_dir, 'm5stats.txt')
174 new_stats = tgt('m5stats.txt')
175 status_file = tgt('status')
176
177 # Base command for running test. We mess around with indirectly
178 # referring to files via SOURCES and TARGETS so that scons can
179 # mess with paths all it wants to and we still get the right
180 # files.
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2006 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

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

173 ref_stats = os.path.join(ref_dir, 'm5stats.txt')
174 new_stats = tgt('m5stats.txt')
175 status_file = tgt('status')
176
177 # Base command for running test. We mess around with indirectly
178 # referring to files via SOURCES and TARGETS so that scons can
179 # mess with paths all it wants to and we still get the right
180 # files.
181 base_cmd = '${SOURCES[0]} -d $TARGET.dir ${SOURCES[1]} %s' % tgt_dir
182 # stdout and stderr files
183 cmd_stdout = '${TARGETS[0]}'
184 cmd_stderr = '${TARGETS[1]}'
181 cmd = '${SOURCES[0]} -d $TARGET.dir'
182 cmd += ' -re --stdout-file ${TARGETS[0]} --stderr-file ${TARGETS[1]}'
183 cmd += ' ${SOURCES[1]} %s' % tgt_dir
185
186 # Prefix test run with batch job submission command if appropriate.
184
185 # Prefix test run with batch job submission command if appropriate.
187 # Output redirection is also different for batch runs.
188 # Batch command also supports timeout arg (in seconds, not minutes).
186 # Batch command also supports timeout arg (in seconds, not minutes).
189 timeout = 15 # used to be a param, probably should be again
187 timeout = 15 * 60 # used to be a param, probably should be again
190 if env['BATCH']:
188 if env['BATCH']:
191 cmd = [env['BATCH_CMD'], '-t', str(timeout * 60),
192 '-o', cmd_stdout, '-e', cmd_stderr, base_cmd]
193 else:
194 cmd = [base_cmd, '>', cmd_stdout, '2>', cmd_stderr]
189 cmd = '%s -t %d %s' % (env['BATCH_CMD'], timeout, cmd)
195
196 env.Command([tgt('stdout'), tgt('stderr'), new_stats],
190
191 env.Command([tgt('stdout'), tgt('stderr'), new_stats],
197 [env.M5Binary, 'run.py'], ' '.join(cmd))
192 [env.M5Binary, 'run.py'], cmd)
198
199 # order of targets is important... see check_test
200 env.Command([tgt('outdiff'), tgt('statsdiff'), status_file],
201 [ref_stats, new_stats],
202 testAction)
203
204 # phony target to echo status
205 if env['update_ref']:

--- 33 unchanged lines hidden ---
193
194 # order of targets is important... see check_test
195 env.Command([tgt('outdiff'), tgt('statsdiff'), status_file],
196 [ref_stats, new_stats],
197 testAction)
198
199 # phony target to echo status
200 if env['update_ref']:

--- 33 unchanged lines hidden ---