1 #******************************************************************
3 # Copyright 2015 Samsung Electronics 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 # ResourceClient Unit Test build script
24 # SConscript file for Local PKI google tests
25 gtest_env = SConscript('#extlibs/gtest/SConscript')
26 lib_env = gtest_env.Clone()
27 target_os = lib_env.get('TARGET_OS')
29 if lib_env.get('RELEASE'):
30 lib_env.AppendUnique(CCFLAGS = ['-Os'])
31 lib_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
33 lib_env.AppendUnique(CCFLAGS = ['-g'])
35 if lib_env.get('LOGGING'):
36 lib_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
38 # Add third party libraries
39 SConscript('#service/third_party_libs.scons', 'lib_env')
41 if target_os in ['linux']:
42 # Verify that 'hippomocks' mocking code is installed. If not,
43 # get it and install it
44 SConscript('#extlibs/hippomocks.scons')
46 rcs_test_env = lib_env.Clone()
48 ######################################################################
50 ######################################################################
51 src_dir = lib_env.get('SRC_DIR')
53 ######################################################################
55 ######################################################################
56 rcs_test_env.AppendUnique(
58 src_dir + '/extlibs/hippomocks-master',
60 '../src/common/utils/include',
63 if target_os not in ['windows']:
64 rcs_test_env.AppendUnique(LIBS = ['dl'])
65 rcs_test_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
66 if target_os != 'android':
67 rcs_test_env.AppendUnique(CXXFLAGS = ['-pthread'])
68 rcs_test_env.AppendUnique(LIBS = ['pthread'])
70 rcs_test_env.PrependUnique(LIBS = [
71 'connectivity_abstraction',
82 ######################################################################
84 ######################################################################
85 rcs_test_src = rcs_test_env.Glob('./*.cpp')
87 rcs_client_test = rcs_test_env.Program('rcs_client_test', rcs_test_src)
88 Alias("rcs_client_test", rcs_client_test)
89 rcs_test_env.AppendTarget('rcs_client_test')
91 if rcs_test_env.get('TEST') == '1':
92 target_os = rcs_test_env.get('TARGET_OS')
93 if target_os in ['linux']:
94 from tools.scons.RunTest import *
95 run_test(rcs_test_env, '', 'service/resource-encapsulation/unittests/rcs_client_test')