blob: a0ced1de4bc2b38eb8112cf0453caf9025e10082 [file] [log] [blame]
Daniel Kurtz67a21bd2014-02-01 00:12:09 +08001#!/usr/bin/python
2
3# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7import common, os
8from autotest_lib.client.bin import utils
9
10version = 2
11
12def setup(top_dir):
13 dst_bin = top_dir + '/glmark2'
14 dst_data = top_dir + '/data'
15
16 # Avoid writing on subsequent setup() calls
17 if (os.path.exists(dst_bin)):
18 return
19
20 # Look for glmark2 or glmark2-es2, installed by app-benchmarks/glmark2
21 # Prefer glmark2 if both are present.
22 src_bin = os.environ['SYSROOT'] + '/usr/bin/glmark2'
23 if not os.path.exists(src_bin):
24 src_bin = os.environ['SYSROOT'] + '/usr/bin/glmark2-es2'
25 if not os.path.exists(src_bin):
26 # TODO: throw an exception here?
27 return
28
29 src_data = os.environ['SYSROOT'] + '/usr/share/glmark2'
30
31 utils.run('cp %s %s' % (src_bin, dst_bin))
32 # Copy glmark2 models, shaders and textures
33 utils.run('cp -R %s %s' % (src_data, dst_data))
34
35pwd = os.getcwd()
36utils.update_version(pwd + '/src', False, version, setup, pwd)