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 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
24 # SConscript file for Local PKI google tests
25 gtest_env = SConscript('#extlibs/gtest/SConscript')
26 catest_env = gtest_env.Clone()
27 target_os = catest_env.get('TARGET_OS')
28 target_transport = catest_env.get('TARGET_TRANSPORT')
30 ######################################################################
32 ######################################################################
33 catest_env.PrependUnique(CPPPATH = [
34 '../../logger/include',
35 '../../stack/include',
36 '../../extlibs/cjson',
37 '../../../oc_logger/include',
40 catest_env.AppendUnique(LIBPATH = [catest_env.get('BUILD_DIR')])
41 catest_env.PrependUnique(LIBS = ['gtest', 'gtest_main'])
42 catest_env.PrependUnique(LIBS = ['octbstack',
43 'connectivity_abstraction',
46 if target_os not in ['arduino', 'darwin', 'ios', 'msys_nt', 'windows']:
47 catest_env.AppendUnique(LIBS=['rt'])
49 if catest_env.get('SECURED') == '1':
50 catest_env.AppendUnique(LIBS = ['tinydtls'])
51 catest_env.AppendUnique(LIBS = ['timer'])
52 if catest_env.get('WITH_TCP') == True:
53 catest_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
55 if catest_env.get('WITH_RD') == '1':
56 catest_env.PrependUnique(LIBS = ['resource_directory'])
58 if catest_env.get('LOGGING'):
59 catest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
61 if target_os in ['msys_nt', 'windows']:
62 catest_env.AppendUnique(LINKFLAGS = ['/subsystem:CONSOLE'])
63 catest_env.AppendUnique(LIBS = ['ws2_32',
67 catest_env.AppendUnique(LIBS = ['m'])
69 ######################################################################
70 # Source files and Targets
71 ######################################################################
73 if (('IP' in target_transport) or ('ALL' in target_transport)):
74 if target_os != 'arduino':
75 catests = catest_env.Program('catests', ['catests.cpp',
76 'caprotocolmessagetest.cpp',
77 'cablocktransfertest.cpp',
78 'ca_api_unittest.cpp',
80 'uarraylist_test.cpp',
85 # Include all unit test files
86 catests = catest_env.Program('catests', ['catests.cpp',
87 'caprotocolmessagetest.cpp',
88 'ca_api_unittest.cpp',
90 'uarraylist_test.cpp',
95 Alias("test", [catests])
97 catest_env.AppendTarget('test')
98 if catest_env.get('TEST') == '1':
99 if target_os in ['linux', 'windows']:
100 catest_env.AppendENVPath('PATH', catest_env.get('BUILD_DIR'))
101 from tools.scons.RunTest import *
103 'resource_csdk_connectivity_test.memcheck',
104 'resource/csdk/connectivity/test/catests')