1 #******************************************************************
3 # Copyright 2014 Intel Mobile Communications GmbH 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 stacktest_env = gtest_env.Clone()
27 target_os = stacktest_env.get('TARGET_OS')
28 rd_mode = stacktest_env.get('RD_MODE')
30 ######################################################################
32 ######################################################################
33 stacktest_env.PrependUnique(CPPPATH = [
34 '../../security/include',
35 '../../ocsocket/include',
36 '../../logger/include',
37 '../../../c_common/ocrandom/include',
38 '../../stack/include',
39 '../../stack/include/internal',
40 '../../connectivity/api',
41 '../../connectivity/inc/pkix',
42 '../../connectivity/external/inc',
43 '../../extlibs/cjson',
44 '../../../oc_logger/include',
47 stacktest_env.AppendUnique(LIBPATH = [stacktest_env.get('BUILD_DIR')])
48 stacktest_env.PrependUnique(LIBS = ['octbstack',
50 'connectivity_abstraction',
52 if target_os != 'darwin':
53 stacktest_env.PrependUnique(LIBS = ['oc_logger'])
55 if stacktest_env.get('SECURED') == '1':
56 stacktest_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
58 if stacktest_env.get('LOGGING'):
59 stacktest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
61 if target_os in ['msys_nt', 'windows']:
62 stacktest_env.AppendUnique(LINKFLAGS = ['/subsystem:CONSOLE'])
63 stacktest_env.AppendUnique(LIBS = ['ws2_32', 'iphlpapi', 'kernel32'])
65 stacktest_env.PrependUnique(LIBS = ['m'])
67 if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
68 stacktest_env.PrependUnique(LIBS = ['resource_directory'])
70 ######################################################################
71 # Source files and Targets
72 ######################################################################
73 stacktests = stacktest_env.Program('stacktests', ['stacktests.cpp'])
74 cbortests = stacktest_env.Program('cbortests', ['cbortests.cpp'])
76 Alias("test", [stacktests, cbortests])
79 stacktest_env.AppendTarget('test')
80 if stacktest_env.get('TEST') == '1':
81 if target_os in ['windows']:
82 stacktest_env.AppendENVPath('PATH', [os.path.join(stacktest_env.get('BUILD_DIR'), 'resource', 'csdk')])
83 if target_os in ['linux', 'windows']:
84 from tools.scons.RunTest import *
85 run_test(stacktest_env,
86 'resource_csdk_stack_test.memcheck',
87 'resource/csdk/stack/test/stacktests')