Merge test folder of test branch
[iotivity.git] / test / build / tizen / es / SConstruct
1 '''
2 /******************************************************************
3 *
4 * Copyright 2016 Samsung Electronics All Rights Reserved.
5 *
6 *
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 ******************************************************************/
21 '''
22
23 print '\n---------------Started Building IotivitySecTest for Tizen---------------\n'
24
25 env = Environment(CC='g++')
26
27 test = ARGUMENTS.get('TEST')
28
29 iotivity_root = 'iotivity'
30 iotivity_test_root = 'test'
31
32 iotivity_include_paths = [
33     iotivity_root + '/resource/include',
34     iotivity_root + '/resource/csdk/include',
35     iotivity_root + '/resource/c_common',
36     iotivity_root + '/resource/csdk/stack/include',
37     iotivity_root + '/resource/csdk/ocsocket/include',
38     iotivity_root + '/resource/csdk/ocrandom/include',
39     iotivity_root + '/resource/oc_logger/include',
40     iotivity_root + '/resource/csdk/resource-directory/include',
41     iotivity_root + '/extlibs/cereal/include',
42     iotivity_root + '/extlibs/timer',
43     iotivity_root + '/extlibs/timer/',
44     iotivity_root + '/resource/c_common/oic_malloc/include',
45     iotivity_root + '/resource/c_common/oic_string/include',
46     iotivity_root + '/resource/csdk/logger/include',
47     iotivity_root + '/extlibs/tinycbor/tinycbor/src',
48     iotivity_root + '/extlibs/timer/',
49     iotivity_root + '/service/easy-setup/enrollee/inc',
50     iotivity_root + '/resource/csdk/logger/include/experimental',
51     iotivity_root + '/service/easy-setup/inc',
52     '/usr/include/dlog'
53 ]
54
55 tc_include_paths = [
56     iotivity_test_root + '/include',
57     iotivity_test_root + '/src/tc/es/gtest/include/enrollee',
58     iotivity_test_root + '/extlibs/gtest-1.7.0/include'
59 ]
60
61 cppflags = Split('-s -pthread -std=gnu++0x -pthread -Wall -DTIZEN -fpermissive -D__TIZEN__ -finstrument-functions')
62
63 libs = Split('boost_system boost_filesystem boost_thread dl expat oc octbstack oc_logger connectivity_abstraction pthread libglib-2.0 dlog ESEnrolleeSDK')
64
65 es_tc_src = [
66     iotivity_test_root + '/src/common/testcase/gtest/IotivitySECTestMain.cpp', 
67     iotivity_test_root + '/src/common/commonutil/c_cpp/CommonUtil.cpp', 
68     iotivity_test_root + '/src/common/commonutil/c_cpp/CommonTestUtil.cpp', 
69     Glob(iotivity_test_root + '/src/tc/es/gtest/src/helper/enrollee/*.cpp'), 
70     Glob(iotivity_test_root + '/src/tc/es/gtest/src/btc/enrollee/*.cpp'),
71     Glob(iotivity_test_root + '/src/tc/es/gtest/src/stc/enrollee/*.cpp')
72 ]
73
74 es_simulator_src = [
75     iotivity_test_root + '/src/testapp/TcpClientApp/tcpclient.cpp', 
76     iotivity_test_root + '/src/common/commonutil/c_cpp/Configuration.cpp'
77 ]
78
79 if 'tc' in test:
80     env.Program(source = es_tc_src, 
81                 target = 'iotivity_es_test', 
82                 CPPPATH = iotivity_include_paths + tc_include_paths, 
83                 LIBS = libs + ['gtest'], 
84                 LIBPATH = [iotivity_test_root + '/extlibs/gtest-1.7.0/bin/tizen'], 
85                 CPPFLAGS = cppflags)
86
87 if 'simulator' in test:
88     env.Program(source = es_simulator_src, 
89                 target = 'iotivity_es_tcp_client', 
90                 CPPPATH = tc_include_paths + [ '/usr/include/dlog' ],
91                 LIBS = libs,
92                 CPPFLAGS = cppflags)