1#!/usr/bin/python2 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 an executable installed by app-benchmarks/glmark2 21 for exe in 'glmark2', 'glmark2-es2', 'glmark2-waffle': 22 src_bin = os.environ['SYSROOT'] + '/usr/bin/' + exe 23 if os.path.exists(src_bin): 24 break 25 else: 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) 37