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 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
23 from tools.scons.RunTest import run_test
27 # SConscript file for Local PKI google tests
28 stacktest_env = test_env.Clone()
29 target_os = stacktest_env.get('TARGET_OS')
30 rd_mode = stacktest_env.get('RD_MODE')
32 ######################################################################
34 ######################################################################
35 stacktest_env.PrependUnique(CPPPATH=[
36 '../../security/include',
37 '../../ocsocket/include',
38 '../../logger/include',
39 '../../../c_common/ocrandom/include',
41 '../../stack/include',
42 '../../stack/include/internal',
43 '../../connectivity/api',
44 '../../connectivity/inc/pkix',
45 '../../connectivity/external/inc',
46 '../../../oc_logger/include',
47 '#resource/csdk/connectivity/inc',
48 '#resource/csdk/connectivity/lib/libcoap-4.1.1/include',
49 '#resource/csdk/connectivity/common/inc',
52 stacktest_env.PrependUnique(LIBS=[
56 'connectivity_abstraction_internal',
60 if stacktest_env.get('SECURED') == '1':
61 stacktest_env.AppendUnique(LIBS=['mbedtls', 'mbedx509'])
63 # c_common calls into mbedcrypto.
64 stacktest_env.AppendUnique(LIBS=['mbedcrypto'])
66 if 'CLIENT' in rd_mode and target_os not in [
67 'arduino', 'darwin', 'ios', 'windows', 'winrt'
69 stacktest_env.PrependUnique(LIBS=['oc', 'oc_logger'])
70 if 'SERVER' in rd_mode:
71 if target_os in ['linux', 'tizen']:
72 stacktest_env.ParseConfig('pkg-config --cflags --libs sqlite3')
73 elif target_os in ['msys_nt', 'windows']:
74 stacktest_env.PrependUnique(LIBS=['sqlite3'])
76 if target_os not in ['msys_nt', 'windows']:
77 stacktest_env.PrependUnique(LIBS=['m'])
79 if target_os in ['tizen', 'linux']:
80 stacktest_env.ParseConfig(
81 "pkg-config --cflags --libs gobject-2.0 gio-2.0 glib-2.0")
83 ######################################################################
84 # Source files and Targets
85 ######################################################################
86 stacktests = stacktest_env.Program('stacktests', ['stacktests.cpp'])
87 cbortests = stacktest_env.Program('cbortests', ['cbortests.cpp'])
89 Alias("test", [stacktests, cbortests])
91 stacktest_env.AppendTarget('test')
92 if stacktest_env.get('TEST') == '1':
93 if target_os in ['linux', 'windows']:
94 run_test(stacktest_env,
95 'resource_csdk_stack_test_stacktests.memcheck',
96 'resource/csdk/stack/test/stacktests')
97 run_test(stacktest_env,
98 'resource_csdk_stack_test_cbortests.memcheck',
99 'resource/csdk/stack/test/cbortests')