aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-29 21:50:34 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-29 21:50:34 +0000
commit123a0b5fbf2e72e8d322a7215db05bb24bfd3cdc (patch)
treec17edb7f0c1038030875be1cb7a8eba2dca98d0a
parent69dc4ffa6f461d85b6323d3ec4ef574ff5ff1f59 (diff)
rebaseline.py: Allow multiple testnames on the command line.
Review URL: https://codereview.appspot.com/6856118 git-svn-id: http://skia.googlecode.com/svn/trunk@6623 2bbb7eff-a529-9590-31e7-b0007b416f81
-rwxr-xr-xtools/rebaseline.py67
1 files changed, 34 insertions, 33 deletions
diff --git a/tools/rebaseline.py b/tools/rebaseline.py
index e907c75e70..a36dbc7376 100755
--- a/tools/rebaseline.py
+++ b/tools/rebaseline.py
@@ -8,8 +8,9 @@ found in the LICENSE file.
'''
'''
-Rebaselines a single GM test, on all bots and all configurations.
-Must be run from an SVN checkout of the gm-expected directory.
+Rebaselines the given GM tests, on all bots and all configurations.
+Must be run from the gm-expected directory. If run from a git or SVN
+checkout, the files will be added to the staging area for commit.
'''
import os, subprocess, sys, tempfile
@@ -37,40 +38,40 @@ pairs = [
'Skia_Xoom_4-1_Float_Release_32'],
]
-if len(sys.argv) != 2:
- print 'Usage: ' + os.path.basename(sys.argv[0]) + ' <testname>'
+if len(sys.argv) < 2:
+ print 'Usage: ' + os.path.basename(sys.argv[0]) + ' <testname> '
+ '[ <testname> ... ]'
exit(1)
-testname = sys.argv[1]
-
is_svn_checkout = os.path.exists(os.path.join('..', '.svn'))
is_git_checkout = os.path.exists(os.path.join('..', '.git'))
-for pair in pairs:
- if (pair[0] == 'base-shuttle-win7-intel-angle'):
- testtypes = [ 'angle' ]
- else:
- testtypes = [ '4444', '565', '8888', 'gpu', 'pdf' ]
- print pair[0] + ':'
- for testtype in testtypes:
- infilename = testname + '_' + testtype + '.png'
- print infilename
+for testname in sys.argv[1:]:
+ for pair in pairs:
+ if (pair[0] == 'base-shuttle-win7-intel-angle'):
+ testtypes = [ 'angle' ]
+ else:
+ testtypes = [ '4444', '565', '8888', 'gpu', 'pdf' ]
+ print pair[0] + ':'
+ for testtype in testtypes:
+ infilename = testname + '_' + testtype + '.png'
+ print infilename
- url = 'http://skia-autogen.googlecode.com/svn/gm-actual/' + pair[0] + '/' + pair[1] + '/' + pair[0] + '/' + infilename
- cmd = [ 'curl', '--fail', '--silent', url ]
- temp = tempfile.NamedTemporaryFile()
- ret = subprocess.call(cmd, stdout=temp)
- if ret != 0:
- print 'Couldn\'t fetch ' + url
- continue
- outfilename = os.path.join(pair[0], infilename);
- cmd = [ 'cp', temp.name, outfilename ]
- subprocess.call(cmd);
- if is_svn_checkout:
- cmd = [ 'svn', 'add', '--quiet', outfilename ]
- subprocess.call(cmd)
- cmd = [ 'svn', 'propset', '--quiet', 'svn:mime-type', 'image/png', outfilename ];
- subprocess.call(cmd)
- elif is_git_checkout:
- cmd = [ 'git', 'add', outfilename ]
- subprocess.call(cmd)
+ url = 'http://skia-autogen.googlecode.com/svn/gm-actual/' + pair[0] + '/' + pair[1] + '/' + pair[0] + '/' + infilename
+ cmd = [ 'curl', '--fail', '--silent', url ]
+ temp = tempfile.NamedTemporaryFile()
+ ret = subprocess.call(cmd, stdout=temp)
+ if ret != 0:
+ print 'Couldn\'t fetch ' + url
+ continue
+ outfilename = os.path.join(pair[0], infilename);
+ cmd = [ 'cp', temp.name, outfilename ]
+ subprocess.call(cmd);
+ if is_svn_checkout:
+ cmd = [ 'svn', 'add', '--quiet', outfilename ]
+ subprocess.call(cmd)
+ cmd = [ 'svn', 'propset', '--quiet', 'svn:mime-type', 'image/png', outfilename ];
+ subprocess.call(cmd)
+ elif is_git_checkout:
+ cmd = [ 'git', 'add', outfilename ]
+ subprocess.call(cmd)