Add a -p option to support calibrating against build SCons packages.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 22 Dec 2009 16:43:30 +0000 (16:43 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 22 Dec 2009 16:43:30 +0000 (16:43 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@4575 fdb21ef1-2011-0410-befe-b5e4ea1792b1

bin/calibrate.py

index c1b4f1157327ce67f73bccca28c81eb0b5a4d0b7..c5d45ce6a4eb06807ff169d211e0b0c6a0f6339a 100644 (file)
@@ -34,11 +34,13 @@ def main(argv=None):
     if argv is None:
         argv = sys.argv
 
-    parser = optparse.OptionParser(usage="calibrate.py [-h] [--min time] [--max time] timings/*/*-run.py")
+    parser = optparse.OptionParser(usage="calibrate.py [-h] [-p PACKAGE], [--min time] [--max time] timings/*/*-run.py")
     parser.add_option('--min', type='float', default=9.5,
                       help="minimum acceptable execution time (default 9.5)")
     parser.add_option('--max', type='float', default=10.00,
                       help="maximum acceptable execution time (default 10.00)")
+    parser.add_option('-p', '--package', type="string",
+                      help="package type")
     opts, args = parser.parse_args(argv[1:])
 
     os.environ['TIMESCONS_CALIBRATE'] = '1'
@@ -47,7 +49,10 @@ def main(argv=None):
         if len(args) > 1:
             print arg + ':'
 
-        command = [sys.executable, 'runtest.py', '--noqmtest', arg]
+        command = [sys.executable, 'runtest.py', '--noqmtest']
+        if opts.package:
+            command.extend(['-p', opts.package])
+        command.append(arg)
 
         run = 1
         good = 0