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 # ResourceBroker 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()
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 SConscript('#service/third_party_libs.scons', 'lib_env')
39 ######################################################################
41 ######################################################################
42 broker_test_env = lib_env.Clone()
43 src_dir = broker_test_env.get('SRC_DIR')
44 target_os = broker_test_env.get('TARGET_OS')
46 ######################################################################
48 ######################################################################
50 broker_test_env.AppendUnique(CPPPATH = ['../include'])
51 broker_test_env.AppendUnique(CPPPATH = ['../../../include'])
52 broker_test_env.AppendUnique(CPPPATH = ['../../common/primitiveResource/include'])
53 broker_test_env.AppendUnique(CPPPATH = ['../../common/expiryTimer/include'])
54 broker_test_env.AppendUnique(CPPPATH = ['../../common/expiryTimer/src'])
55 broker_test_env.AppendUnique(CPPPATH = ['../../common/utils/include'])
57 broker_test_env.PrependUnique(CPPPATH = [broker_test_env.get('SRC_DIR')+'/extlibs/hippomocks-master'])
58 broker_test_env.AppendUnique(LIBPATH = [broker_test_env.get('BUILD_DIR')])
60 broker_test_env.PrependUnique(LIBS = ['coap'])
61 broker_test_env.AppendUnique(LIBS = ['connectivity_abstraction'])
62 broker_test_env.AppendUnique(LIBS = ['oc_logger'])
63 broker_test_env.AppendUnique(LIBS = ['octbstack'])
64 broker_test_env.AppendUnique(LIBS = ['oc'])
65 broker_test_env.AppendUnique(LIBS = ['rcs_client'])
66 broker_test_env.AppendUnique(LIBS = ['rcs_common'])
67 broker_test_env.AppendUnique(LIBS = ['gtest'])
68 broker_test_env.AppendUnique(LIBS = ['gtest_main'])
70 compiler = broker_test_env.get('CXX')
72 broker_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
74 if target_os not in ['windows']:
75 broker_test_env.AppendUnique(LIBS = ['pthread'])
77 ######################################################################
79 ######################################################################
81 broker_test_src = broker_test_env.Glob('./*.cpp')
82 broker_test = broker_test_env.Program('broker_test', broker_test_src)
83 Alias("broker_test", broker_test)
84 broker_test_env.AppendTarget('broker_test')
86 if broker_test_env.get('TEST') == '1':
87 if target_os in ['linux']:
88 from tools.scons.RunTest import *
89 run_test(broker_test_env,
91 'service/resource-encapsulation/src/resourceBroker/unittest/broker_test')