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 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 # SConscript file for Local PKI google tests
22 gtest_env = SConscript('#extlibs/gtest/SConscript')
23 lib_env = gtest_env.Clone()
26 # ResourceClient Unit Test build script
28 if lib_env.get('RELEASE'):
29 lib_env.AppendUnique(CCFLAGS = ['-Os'])
30 lib_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
32 lib_env.AppendUnique(CCFLAGS = ['-g'])
34 if lib_env.get('LOGGING'):
35 lib_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
37 # Add third party libraries
38 SConscript(lib_env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
40 target_os = lib_env.get('TARGET_OS')
41 if target_os == 'linux':
42 # Verify that 'hippomocks' mocking code is installed. If not,
43 # get it and install it
44 SConscript(lib_env.get('SRC_DIR') + '/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', 'winrt']:
64 rcs_test_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
65 if target_os != 'android':
66 rcs_test_env.AppendUnique(CXXFLAGS = ['-pthread'])
67 rcs_test_env.AppendUnique(LIBS = ['pthread'])
69 rcs_test_env.PrependUnique(LIBS = [
70 'connectivity_abstraction',
81 rcs_test_env.AppendUnique(LIBS = ['dl'])
83 ######################################################################
85 ######################################################################
86 rcs_test_src = rcs_test_env.Glob('./*.cpp')
88 rcs_client_test = rcs_test_env.Program('rcs_client_test', rcs_test_src)
89 Alias("rcs_client_test", rcs_client_test)
90 rcs_test_env.AppendTarget('rcs_client_test')
92 if rcs_test_env.get('TEST') == '1':
93 target_os = rcs_test_env.get('TARGET_OS')
94 if target_os == 'linux':
95 from tools.scons.RunTest import *
96 run_test(rcs_test_env, '', 'service/resource-encapsulation/unittests/rcs_client_test')