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 with_ra = env.get('WITH_RA')
28 with_ra_ibb = env.get('WITH_RA_IBB')
29 ######################################################################
31 ######################################################################
32 provisiontests_env.PrependUnique(CPPPATH = [
34 '../../oc_logger/include',
35 '../../csdk/stack/include',
36 '../../csdk/security/include',
37 '../../csdk/security/provisioning/include',
38 '../../csdk/security/provisioning/include/oxm',
39 '../../csdk/security/provisioning/include/internal',
40 '../../csdk/stack/include/internal',
41 '../../csdk/connectivity/api',
42 '../../csdk/connectivity/external/inc',
43 '../../csdk/ocsocket/include',
44 '../../csdk/ocrandom/include',
45 '../../csdk/logger/include',
46 '../../../extlibs/gtest/gtest-1.7.0/include',
47 '../../../extlibs/hippomocks-master/HippoMocks',
48 '../../../extlibs/hippomocks-master/HippoMocksTest'
51 provisiontests_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
52 provisiontests_env.AppendUnique(LIBS = ['-lpthread', '-ldl'])
53 provisiontests_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
54 provisiontests_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
55 provisiontests_env.PrependUnique(LIBS = [
61 'connectivity_abstraction',
68 provisiontests_env.AppendUnique(LIBS = provisiontests_env['RALIBS'], LIBPATH = provisiontests_env['RALIBPATH'], RPATH = provisiontests_env['RARPATH'])
69 print "RALIBS = %s" % provisiontests_env['RALIBS']
70 print "RALIBPATH = %s" % provisiontests_env['RALIBPATH']
71 print "RARPATH = %s" % provisiontests_env['RARPATH']
74 provisiontests_env.AppendUnique(LIBS = ['ra_xmpp'])
76 if env.get('SECURED') == '1':
77 provisiontests_env.AppendUnique(LIBS = ['tinydtls'])
78 provisiontests_env.AppendUnique(LIBS = ['timer'])
79 if env.get('DTLS_WITH_X509') == '1':
80 provisiontests_env.AppendUnique(LIBS = ['CKManager'])
81 provisiontests_env.AppendUnique(LIBS = ['asn1'])
84 if env.get('LOGGING'):
85 provisiontests_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
87 ######################################################################
88 # Source files and Targets
89 ######################################################################
90 unittests = provisiontests_env.Program('provisiontests', ['OCProvisioningTest.cpp'])
92 Alias("provisiontests", [unittests])
94 env.AppendTarget('provisiontests')
95 if env.get('TEST') == '1':
96 target_os = env.get('TARGET_OS')
97 if target_os == 'linux':
98 out_dir = env.get('BUILD_DIR')
99 result_dir = env.get('BUILD_DIR') + '/test_out/'
100 if not os.path.isdir(result_dir):
101 os.makedirs(result_dir)
102 provisiontests_env.AppendENVPath('GTEST_OUTPUT', ['xml:'+ result_dir])
103 provisiontests_env.AppendENVPath('LD_LIBRARY_PATH', [out_dir])
104 provisiontests_env.AppendENVPath('LD_LIBRARY_PATH', ['./extlibs/gtest/gtest-1.7.0/lib/.libs'])
105 ut = provisiontests_env.Command ('ut', None, out_dir + 'resource/provisioning/unittests/provisiontests')
108 src_dir = provisiontests_env.get('SRC_DIR')
109 svr_db_src_dir = src_dir + '/resource/provisioning/examples/'
110 svr_db_build_dir = env.get('BUILD_DIR') +'/resource/provisioning/unittests/'
111 provisiontests_env.Alias("install", provisiontests_env.Install( svr_db_build_dir,
112 svr_db_src_dir + 'oic_svr_db_client.json'))