Imported Upstream version 1.1.0
[platform/upstream/iotivity.git] / resource / c_common / oic_time / test / SConscript
1 #******************************************************************
2 #
3 # Copyright 2015 Intel Mobile Communications GmbH All Rights Reserved.
4 #
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 #
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
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
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.
18 #
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21
22 Import('env')
23 import os
24
25
26 timetest_env = env.Clone()
27 src_dir = timetest_env.get('SRC_DIR')
28
29 ######################################################################
30 # Build flags
31 ######################################################################
32 timetest_env.PrependUnique(CPPPATH = [
33         '../include',
34         '#extlibs/gtest/gtest-1.7.0/include' ])
35
36 timetest_env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource/c_common')])
37 timetest_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
38 timetest_env.PrependUnique(LIBS = ['c_common', 'gtest', 'gtest_main', 'pthread'])
39 timetest_env.Append(LIBS = ['rt']);
40
41 if env.get('LOGGING'):
42     timetest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
43 #
44 ######################################################################
45 # Source files and Targets
46 ######################################################################
47 timetests = timetest_env.Program('timetests', ['linux/oic_time_tests.cpp'])
48
49 Alias("test", [timetests])
50
51 env.AppendTarget('test')
52 if env.get('TEST') == '1':
53     target_os = env.get('TARGET_OS')
54     if target_os == 'linux':
55                 from tools.scons.RunTest import *
56                 run_test(timetest_env,
57                          'resource_ccommon_time_test.memcheck',
58                          'resource/c_common/oic_time/test/timetests')