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 path = list(ref_dir.split('/')) |
271 |
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 |
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 |
345src = Dir('.').srcdir |
346for config in configs: |
347 dirs = src.glob('*/*/*/ref/%s/*/%s' % (env['TARGET_ISA'], config)) |
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) |