1 #******************************************************************
3 # Copyright 2016 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 # Mediator[RichSDK] Unit Test build script
26 # SConscript file for Local PKI google tests
27 gtest_env = SConscript('#extlibs/gtest/SConscript')
28 lib_env = gtest_env.Clone()
30 if lib_env.get('RELEASE'):
31 lib_env.AppendUnique(CCFLAGS = ['-Os'])
32 lib_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
34 lib_env.AppendUnique(CCFLAGS = ['-g'])
36 if lib_env.get('LOGGING'):
37 lib_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
39 # Add third party libraries
40 SConscript('#service/third_party_libs.scons', 'lib_env')
42 target_os = lib_env.get('TARGET_OS')
43 if target_os in ['linux']:
44 # Verify that 'hippomocks' mocking code is installed. If not,
45 # get it and install it
46 SConscript('#extlibs/hippomocks.scons')
48 mediator_rich_test_env = lib_env.Clone()
50 ######################################################################
52 ######################################################################
53 src_dir = lib_env.get('SRC_DIR')
55 ######################################################################
57 ######################################################################
59 mediator_rich_test_env.AppendUnique(
61 src_dir + '/extlibs/hippomocks-master',
66 if mediator_rich_test_env.get('SECURED') == '1':
67 mediator_rich_test_env.PrependUnique(LIBS = ['tinydtls','ocprovision', 'ocpmapi', 'timer'])
69 mediator_rich_test_env.PrependUnique(LIBS = [
75 ######################################################################
77 ######################################################################
78 mediator_richsdk_test_src = mediator_rich_test_env.Glob('./*.cpp')
80 mediator_richsdk_test = mediator_rich_test_env.Program('mediator_richsdk_test', mediator_richsdk_test_src)
81 Alias("mediator_richsdk_test", mediator_richsdk_test)
82 mediator_rich_test_env.AppendTarget('mediator_richsdk_test')
84 if mediator_rich_test_env.get('TEST') == '1':
85 if target_os in ['linux']:
86 from tools.scons.RunTest import *
87 run_test(mediator_rich_test_env, '', 'service/easy-setup/mediator/richsdk/unittests/mediator_richsdk_test')