1#! /usr/bin/env python |
2# Copyright (c) 2005-2006 The Regents of The University of Michigan |
3# All rights reserved. 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; 9# redistributions in binary form must reproduce the above copyright 10# notice, this list of conditions and the following disclaimer in the --- 34 unchanged lines hidden (view full) --- 45optparser = optparse.OptionParser() 46optparser.add_option('-v', '--verbose', dest='verbose', action='store_true', 47 default=False, 48 help='echo commands before executing') 49optparser.add_option('--scratch', dest='scratch', action='store_true', 50 default=False, 51 help='rebuld from scratch') 52optparser.add_option('--builds', dest='builds', |
53 default='ALPHA_SE,ALPHA_FS,MIPS_SE,SPARC_SE', |
54 help='comma-separated list of builds to test') 55optparser.add_option('--variants', dest='variants', 56 default='opt', 57 help='comma-separated list of build variants to test') 58optparser.add_option('--workdir', dest='workdir', 59 help='directory for checked-out source trees') 60optparser.add_option('--scons-opts', dest='scons_opts', default='', 61 help='scons options') --- 7 unchanged lines hidden (view full) --- 69(options, tests) = optparser.parse_args() 70 71 72# split list options on ',' to get Python lists 73builds = options.builds.split(',') 74variants = options.variants.split(',') 75 76# Repositories to clone/update |
77repos = ['m5'] |
78 79# Call os.system() and raise exception if return status is non-zero 80def system(cmd): 81 if options.verbose: 82 print cmd 83 status = os.system(cmd) 84 if status != 0: 85 upper = (status & 0xff00) >> 8 --- 49 unchanged lines hidden (view full) --- 135 for dir in repos: 136 system('cd %s; bk pull' % dir) 137 138 if not tests: 139 print "No tests specified." 140 sys.exit(1) 141 142 if options.verbose: |
143 print 'cd m5' 144 os.chdir('m5') |
145 |
146 if 'all' in tests: 147 targets = ['build/%s/tests/%s' % (build, variant) 148 for build in builds 149 for variant in variants] 150 else: 151 targets = ['build/%s/tests/%s/%s' % (build, variant, test) 152 for build in builds 153 for variant in variants 154 for test in tests] |
155 156 system('scons %s %s' % (options.scons_opts, ' '.join(targets))) 157 158 sys.exit(0) 159 160except OSError, exc: 161 print "%s: " % progname, exc 162 sys.exit(1) |