2012-10-29 18:06:26 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
'''
|
|
|
|
Copyright 2012 Google Inc.
|
|
|
|
|
|
|
|
Use of this source code is governed by a BSD-style license that can be
|
|
|
|
found in the LICENSE file.
|
|
|
|
'''
|
|
|
|
|
|
|
|
'''
|
2012-11-29 21:50:34 +00:00
|
|
|
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.
|
2012-10-29 18:06:26 +00:00
|
|
|
'''
|
|
|
|
|
|
|
|
import os, subprocess, sys, tempfile
|
|
|
|
|
|
|
|
pairs = [
|
|
|
|
['base-shuttle-win7-intel-float',
|
2013-04-30 12:02:32 +00:00
|
|
|
'Test-Win7-ShuttleA-HD2000-x86-Release'],
|
2012-10-30 14:34:55 +00:00
|
|
|
['base-shuttle-win7-intel-angle',
|
2013-04-30 12:02:32 +00:00
|
|
|
'Test-Win7-ShuttleA-HD2000-x86-Release-ANGLE'],
|
2012-10-30 14:34:55 +00:00
|
|
|
['base-shuttle-win7-intel-directwrite',
|
2013-04-30 12:02:32 +00:00
|
|
|
'Test-Win7-ShuttleA-HD2000-x86-Release-DirectWrite'],
|
2012-10-29 18:06:26 +00:00
|
|
|
['base-shuttle_ubuntu12_ati5770',
|
2013-04-30 12:02:32 +00:00
|
|
|
'Test-Ubuntu12-ShuttleA-ATI5770-x86_64-Release'],
|
2012-10-29 18:06:26 +00:00
|
|
|
['base-macmini',
|
2013-04-30 12:02:32 +00:00
|
|
|
'Test-Mac10.6-MacMini4.1-GeForce320M-x86-Release'],
|
2012-10-29 18:06:26 +00:00
|
|
|
['base-macmini-lion-float',
|
2013-04-30 12:02:32 +00:00
|
|
|
'Test-Mac10.7-MacMini4.1-GeForce320M-x86-Release'],
|
2012-10-29 18:06:26 +00:00
|
|
|
['base-android-galaxy-nexus',
|
2013-05-03 20:24:54 +00:00
|
|
|
'Test-Android-GalaxyNexus-SGX540-Arm7-Debug'],
|
2012-10-29 18:06:26 +00:00
|
|
|
['base-android-nexus-7',
|
2013-04-30 12:02:32 +00:00
|
|
|
'Test-Android-Nexus7-Tegra3-Arm7-Release'],
|
2012-10-29 18:06:26 +00:00
|
|
|
['base-android-nexus-s',
|
2013-04-30 12:02:32 +00:00
|
|
|
'Test-Android-NexusS-SGX540-Arm7-Release'],
|
2012-10-29 18:06:26 +00:00
|
|
|
['base-android-xoom',
|
2013-04-30 12:02:32 +00:00
|
|
|
'Test-Android-Xoom-Tegra2-Arm7-Release'],
|
2013-05-14 18:20:00 +00:00
|
|
|
['base-android-nexus-10',
|
|
|
|
'Test-Android-Nexus10-MaliT604-Arm7-Release'],
|
2012-10-29 18:06:26 +00:00
|
|
|
]
|
|
|
|
|
2012-11-29 21:50:34 +00:00
|
|
|
if len(sys.argv) < 2:
|
|
|
|
print 'Usage: ' + os.path.basename(sys.argv[0]) + ' <testname> '
|
|
|
|
'[ <testname> ... ]'
|
2012-10-29 18:06:26 +00:00
|
|
|
exit(1)
|
|
|
|
|
2012-12-07 17:19:07 +00:00
|
|
|
is_svn_checkout = os.path.exists('.svn') or os.path.exists(os.path.join('..', '.svn') )
|
|
|
|
is_git_checkout = os.path.exists('.git') or os.path.exists(os.path.join('..', '.git'))
|
2012-11-07 22:32:12 +00:00
|
|
|
|
2012-11-29 21:50:34 +00:00
|
|
|
for testname in sys.argv[1:]:
|
|
|
|
for pair in pairs:
|
|
|
|
if (pair[0] == 'base-shuttle-win7-intel-angle'):
|
2013-05-17 14:10:59 +00:00
|
|
|
testtypes = [ 'angle', 'anglemsaa16' ]
|
2012-11-29 21:50:34 +00:00
|
|
|
else:
|
2013-05-17 14:10:59 +00:00
|
|
|
testtypes = [ '565', '8888', 'gpu', 'pdf', 'mesa', 'msaa16', 'msaa4' ]
|
2012-11-29 21:50:34 +00:00
|
|
|
print pair[0] + ':'
|
|
|
|
for testtype in testtypes:
|
|
|
|
infilename = testname + '_' + testtype + '.png'
|
|
|
|
print infilename
|
2012-10-29 18:06:26 +00:00
|
|
|
|
2012-11-29 21:50:34 +00:00
|
|
|
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)
|