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 # //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
25 sptest_env = env.Clone()
27 src_dir = sptest_env.get('SRC_DIR')
29 ######################################################################
31 ######################################################################
32 sptest_env.PrependUnique(CPPPATH = [
33 '../../../connectivity/inc',
34 '../../../connectivity/api',
36 '../../../../../extlibs/tinydtls',
37 '../include/internal',
38 '../../../logger/include',
39 '../../../stack/include',
40 '../../../../oc_logger/include',
41 '../../../../../extlibs/gtest/gtest-1.7.0/include',
44 sptest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
45 sptest_env.AppendUnique(LIBS = ['-lpthread'])
46 sptest_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
47 sptest_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
48 sptest_env.PrependUnique(LIBS = [ 'ocspapi',
52 'connectivity_abstraction',
57 if env.get('SECURED') == '1':
58 sptest_env.AppendUnique(LIBS = ['tinydtls'])
60 if not env.get('RELEASE'):
61 sptest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
63 ######################################################################
64 # Source files and Targets
65 ######################################################################
66 unittest = sptest_env.Program('unittest', ['provisioningmanager.cpp'])
68 Alias("test", [unittest])
70 env.AppendTarget('test')
71 if env.get('TEST') == '1':
72 target_os = env.get('TARGET_OS')
73 if target_os == 'linux':
74 out_dir = env.get('BUILD_DIR')
75 result_dir = env.get('BUILD_DIR') + '/test_out/'
76 if not os.path.isdir(result_dir):
77 os.makedirs(result_dir)
78 sptest_env.AppendENVPath('GTEST_OUTPUT', ['xml:'+ result_dir])
79 sptest_env.AppendENVPath('LD_LIBRARY_PATH', [out_dir])
80 sptest_env.AppendENVPath('LD_LIBRARY_PATH', ['./extlibs/gtest/gtest-1.7.0/lib/.libs'])
81 ut = sptest_env.Command ('ut', None, out_dir + '/resource/csdk/security/unittest/unittest')