SConscript (9922:4eec8250c38d) | SConscript (10196:be0e1724eb39) |
---|---|
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 --- 253 unchanged lines hidden (view full) --- 262 return env.subst("Updating ${SOURCES[0].dir} from ${SOURCES[1].dir}", 263 target=target, source=source) 264 265updateAction = env.Action(update_test, update_test_string) 266 267def test_builder(env, ref_dir): 268 """Define a test.""" 269 | 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 --- 253 unchanged lines hidden (view full) --- 262 return env.subst("Updating ${SOURCES[0].dir} from ${SOURCES[1].dir}", 263 target=target, source=source) 264 265updateAction = env.Action(update_test, update_test_string) 266 267def test_builder(env, ref_dir): 268 """Define a test.""" 269 |
270 (category, mode, name, _ref, isa, opsys, config) = ref_dir.split('/') 271 assert(_ref == 'ref') | 270 path = list(ref_dir.split('/')) |
272 | 271 |
273 # target path (where test output goes) is the same except without 274 # the 'ref' component 275 tgt_dir = os.path.join(category, mode, name, isa, opsys, config) | 272 # target path (where test output goes) consists of category, mode, 273 # name, isa, opsys, and config (skips the 'ref' component) 274 assert(path.pop(-4) == 'ref') 275 tgt_dir = os.path.join(*path[-6:]) |
276 | 276 |
277 # prepend file name with tgt_dir | 277 # local closure for prepending target path to filename |
278 def tgt(f): 279 return os.path.join(tgt_dir, f) 280 281 ref_stats = os.path.join(ref_dir, 'stats.txt') 282 new_stats = tgt('stats.txt') 283 status_file = tgt('status') 284 285 env.Command([status_file, new_stats], --- 51 unchanged lines hidden (view full) --- 337 'tgen-simple-dram'] 338 339if env['PROTOCOL'] != 'None': 340 if env['PROTOCOL'] == 'MI_example': 341 configs += [c + "-ruby" for c in configs] 342 else: 343 configs = [c + "-ruby-" + env['PROTOCOL'] for c in configs] 344 | 278 def tgt(f): 279 return os.path.join(tgt_dir, f) 280 281 ref_stats = os.path.join(ref_dir, 'stats.txt') 282 new_stats = tgt('stats.txt') 283 status_file = tgt('status') 284 285 env.Command([status_file, new_stats], --- 51 unchanged lines hidden (view full) --- 337 'tgen-simple-dram'] 338 339if env['PROTOCOL'] != 'None': 340 if env['PROTOCOL'] == 'MI_example': 341 configs += [c + "-ruby" for c in configs] 342 else: 343 configs = [c + "-ruby-" + env['PROTOCOL'] for c in configs] 344 |
345cwd = os.getcwd() 346os.chdir(str(Dir('.').srcdir)) | 345src = Dir('.').srcdir |
347for config in configs: | 346for config in configs: |
348 dirs = glob.glob('*/*/*/ref/%s/*/%s' % (env['TARGET_ISA'], config)) | 347 dirs = src.glob('*/*/*/ref/%s/*/%s' % (env['TARGET_ISA'], config)) |
349 for d in dirs: | 348 for d in dirs: |
349 d = str(d) |
|
350 if not os.path.exists(os.path.join(d, 'skip')): 351 test_builder(env, d) | 350 if not os.path.exists(os.path.join(d, 'skip')): 351 test_builder(env, d) |
352os.chdir(cwd) | |