Created SConscripts for the C and C++ unit tests.
[platform/upstream/iotivity.git] / extlibs / hippomocks.scons
1 ##
2 # 'hippomocks' script to check if Hippo Mocks Unit Test library is installed.
3 # If not, get it and install it
4 #
5 ##
6
7 import os, sys
8
9 Import('env')
10
11 target_os = env.get('TARGET_OS')
12 src_dir = env.get('SRC_DIR')
13
14 # Only verify/install on linux
15 if target_os == 'linux':
16         print '*** Checking for installation of hippomocks ***'
17
18         hippomocks_dir      = src_dir + '/extlibs/hippomocks-master'
19         hippomocks_zip_file = src_dir + '/extlibs/master.zip'
20         hippomocks_url      = 'https://github.com/dascandy/hippomocks/archive/master.zip'
21
22         if not os.path.exists(hippomocks_dir):
23                 # If the hippomocks zip file is not already present, download it
24                 if not os.path.exists(hippomocks_zip_file):
25                         hippomocks_zip = env.Download(hippomocks_zip_file, hippomocks_url)
26                 else:
27                         hippomocks_zip = hippomocks_zip_file
28
29                 # Unzip hippomocks
30                 print 'Unzipping hippomocks'
31                 env.UnpackAll(hippomocks_dir, hippomocks_zip)
32
33