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 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
23 from tools.scons.RunTest import *
27 # SConscript file for Local PKI google tests
28 catest_env = test_env.Clone()
29 target_os = catest_env.get('TARGET_OS')
30 target_transport = catest_env.get('TARGET_TRANSPORT')
31 rd_mode = catest_env.get('RD_MODE')
33 ######################################################################
35 ######################################################################
36 catest_env.PrependUnique(CPPPATH = [
37 '../../logger/include',
38 '../../stack/include',
39 '../../../oc_logger/include',
42 catest_env.AppendUnique(LIBPATH = [catest_env.get('BUILD_DIR')])
43 catest_env.PrependUnique(LIBS = ['octbstack_test',
44 'connectivity_abstraction',
47 if target_os not in ['arduino', 'darwin', 'ios', 'msys_nt', 'windows']:
48 catest_env.AppendUnique(LIBS=['rt'])
50 if catest_env.get('SECURED') == '1':
51 catest_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
53 if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
54 catest_env.PrependUnique(LIBS = ['resource_directory'])
56 if catest_env.get('LOGGING'):
57 catest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
59 if target_os not in ['msys_nt', 'windows']:
60 catest_env.AppendUnique(LIBS = ['m'])
62 ######################################################################
63 # Source files and Targets
64 ######################################################################
68 'caprotocolmessagetest.cpp',
69 'ca_api_unittest.cpp',
71 'uarraylist_test.cpp',
76 if (('IP' in target_transport) or ('ALL' in target_transport)):
77 if target_os != 'arduino':
78 tests_src = tests_src + ['cablocktransfertest.cpp']
80 if catest_env.get('SECURED') == '1' and catest_env.get('WITH_TCP') == True:
81 tests_src = tests_src + ['ssladapter_test.cpp']
83 catests = catest_env.Program('catests', tests_src)
85 Alias("test", [catests])
87 catest_env.AppendTarget('test')
88 # TODO: fix test in supported configurations
89 if catest_env.get('TEST') == '1' and catest_env.get('SECURED') != '1':
90 if target_os in ['linux', 'windows']:
91 catest_env.AppendENVPath('PATH', catest_env.get('BUILD_DIR'))
93 'resource_csdk_connectivity_test.memcheck',
94 'resource/csdk/connectivity/test/catests')