blob: f0691081102dcf9e17747e657d7f37db29ed8ecb [file] [log] [blame]
senorblanco@chromium.org782f3b42012-10-29 18:06:26 +00001#!/usr/bin/python
2
3'''
4Copyright 2012 Google Inc.
5
6Use of this source code is governed by a BSD-style license that can be
7found in the LICENSE file.
8'''
9
10'''
11Rebaselines a single GM test, on all bots and all configurations.
12Must be run from an SVN checkout of the gm-expected directory.
13'''
14
15import os, subprocess, sys, tempfile
16
17pairs = [
18 ['base-shuttle-win7-intel-float',
19 'Skia_Shuttle_Win7_Intel_Float_Release_32'],
20# ['base-shuttle-win7-intel-angle',
21# 'Skia_Shuttle_Win7_Intel_Float_ANGLE_Release_32'],
22# ['base-shuttle-win7-intel-directwrite',
23# 'Skia_Shuttle_Win7_Intel_Float_DirectWrite_Release_32'],
24 ['base-shuttle_ubuntu12_ati5770',
25 'Skia_Shuttle_Ubuntu12_ATI5770_Float_Release_64'],
26 ['base-macmini',
27 'Skia_Mac_Float_Release_32'],
28 ['base-macmini-lion-float',
29 'Skia_MacMiniLion_Float_Release_32'],
30 ['base-android-galaxy-nexus',
31 'Skia_GalaxyNexus_4-1_Float_Release_32'],
32 ['base-android-nexus-7',
33 'Skia_Nexus7_4-1_Float_Release_32'],
34 ['base-android-nexus-s',
35 'Skia_NexusS_4-1_Float_Release_32'],
36 ['base-android-xoom',
37 'Skia_Xoom_4-1_Float_Release_32'],
38]
39
40if len(sys.argv) != 2:
41 print 'Usage: ' + os.path.basename(sys.argv[0]) + ' <testname>'
42 exit(1)
43
44testname = sys.argv[1]
45testtypes = [ '4444', '565', '8888', 'gpu', 'pdf' ]
46
47for pair in pairs:
48 print pair[0] + ':'
49 for testtype in testtypes:
50 infilename = testname + '_' + testtype + '.png'
51 print infilename
52
53 url = 'http://skia-autogen.googlecode.com/svn/gm-actual/' + pair[0] + '/' + pair[1] + '/' + pair[0] + '/' + infilename
54 cmd = [ 'curl', '--fail', '--silent', url ]
55 temp = tempfile.NamedTemporaryFile()
56 ret = subprocess.call(cmd, stdout=temp)
57 if ret != 0:
58 print 'Couldn\'t fetch ' + url
59 continue
60 outfilename = os.path.join(pair[0], infilename);
61 cmd = [ 'cp', temp.name, outfilename ]
62 subprocess.call(cmd);
63 cmd = [ 'svn', 'add', '--quiet', outfilename ]
64 subprocess.call(cmd)