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 provisiontests_env = env.Clone()
26 src_dir = provisiontests_env.get('SRC_DIR')
27 ######################################################################
29 ######################################################################
30 provisiontests_env.PrependUnique(CPPPATH = [
32 '../../oc_logger/include',
33 '../../csdk/stack/include',
34 '../../csdk/security/include',
35 '../../csdk/security/provisioning/include',
36 '../../csdk/security/provisioning/include/oxm',
37 '../../csdk/security/provisioning/include/internal',
38 '../../csdk/stack/include/internal',
39 '../../csdk/connectivity/api',
40 '../../csdk/connectivity/external/inc',
41 '../../csdk/ocsocket/include',
42 '../../csdk/ocrandom/include',
43 '../../csdk/logger/include',
44 '../../../extlibs/gtest/gtest-1.7.0/include',
45 '../../../extlibs/hippomocks-master/HippoMocks',
46 '../../../extlibs/hippomocks-master/HippoMocksTest'
49 provisiontests_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
50 provisiontests_env.AppendUnique(LIBS = ['-lpthread', '-ldl'])
51 provisiontests_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
52 provisiontests_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
53 provisiontests_env.PrependUnique(LIBS = [
59 'connectivity_abstraction',
65 if env.get('SECURED') == '1':
66 provisiontests_env.AppendUnique(LIBS = ['tinydtls'])
67 if env.get('DTLS_WITH_X509') == '1':
68 provisiontests_env.AppendUnique(LIBS = ['CKManager'])
69 provisiontests_env.AppendUnique(LIBS = ['asn1'])
72 if env.get('LOGGING'):
73 provisiontests_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
75 ######################################################################
76 # Source files and Targets
77 ######################################################################
78 unittests = provisiontests_env.Program('provisiontests', ['OCProvisioningTest.cpp'])
80 Alias("provisiontests", [unittests])
82 env.AppendTarget('provisiontests')
83 if env.get('TEST') == '1':
84 target_os = env.get('TARGET_OS')
85 if target_os == 'linux':
86 out_dir = env.get('BUILD_DIR')
87 result_dir = env.get('BUILD_DIR') + '/test_out/'
88 if not os.path.isdir(result_dir):
89 os.makedirs(result_dir)
90 provisiontests_env.AppendENVPath('GTEST_OUTPUT', ['xml:'+ result_dir])
91 provisiontests_env.AppendENVPath('LD_LIBRARY_PATH', [out_dir])
92 provisiontests_env.AppendENVPath('LD_LIBRARY_PATH', ['./extlibs/gtest/gtest-1.7.0/lib/.libs'])
93 ut = provisiontests_env.Command ('ut', None, out_dir + 'resource/provisioning/unittests/provisiontests')
96 src_dir = provisiontests_env.get('SRC_DIR')
97 svr_db_src_dir = src_dir + '/resource/provisioning/examples/'
98 svr_db_build_dir = env.get('BUILD_DIR') +'/resource/provisioning/unittests/'
99 provisiontests_env.Alias("install", provisiontests_env.Install( svr_db_build_dir,
100 svr_db_src_dir + 'oic_svr_db_client.json'))