1 #******************************************************************
3 # Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 # 'hippomocks' script to check if Hippo Mocks Unit Test library is installed.
23 # If not, get it and install it
31 target_os = env.get('TARGET_OS')
32 src_dir = env.get('SRC_DIR')
34 # Only verify/install on linux
35 if target_os == 'linux':
36 print '*** Checking for installation of hippomocks ***'
38 hippomocks_sha = '2f40aa11e31499432283b67f9d3449a3cd7b9c4d'
39 hippomocks_dir_src = src_dir + '/extlibs/hippomocks-' + hippomocks_sha
40 hippomocks_dir_dest = src_dir + '/extlibs/hippomocks-master'
41 hippomocks_zip_file = src_dir + '/extlibs/hippomocks-' + hippomocks_sha + '.zip'
42 hippomocks_url = 'https://github.com/dascandy/hippomocks/archive/' + hippomocks_sha + '.zip'
44 if not os.path.exists(hippomocks_dir_dest):
45 # If the hippomocks zip file is not already present, download it
46 if not os.path.exists(hippomocks_zip_file):
47 hippomocks_zip = env.Download(hippomocks_zip_file, hippomocks_url)
49 hippomocks_zip = hippomocks_zip_file
52 print 'Unzipping hippomocks'
53 env.UnpackAll(hippomocks_dir_src, hippomocks_zip)
54 print 'Renaming hippomocks directory'
55 os.rename(hippomocks_dir_src, hippomocks_dir_dest)