Make OCProcessEvent method.
[platform/upstream/iotivity.git] / resource / c_common / ocevent / test / SConscript
1 #******************************************************************
2 #
3 # Copyright 2017  Microsoft
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 import os
22 import os.path
23 from tools.scons.RunTest import *
24
25 Import('test_env')
26
27 eventtests_env = test_env.Clone()
28 target_os = eventtests_env.get('TARGET_OS')
29
30 ######################################################################
31 # Build flags
32 ######################################################################
33 eventtests_env.PrependUnique(CPPPATH=['#resource/c_common/ocevent/include'])
34
35 eventtests_env.AppendUnique(LIBPATH=[eventtests_env.get('BUILD_DIR')])
36 eventtests_env.Append(LIBS=['logger'])
37
38 if eventtests_env.get('LOGGING'):
39     eventtests_env.AppendUnique(CPPDEFINES=['TB_LOG'])
40
41 ######################################################################
42 # Source files and Targets
43 ######################################################################
44 eventtests = eventtests_env.Program('eventtests', ['eventtest.cpp'])
45
46 Alias("test", [eventtests])
47
48 eventtests_env.AppendTarget('test')
49 if eventtests_env.get('TEST') == '1':
50     if target_os in ['linux', 'windows']:
51         run_test(eventtests_env,
52                  'resource_c_common_event_test.memcheck',
53                  'resource/c_common/ocevent/test/eventtests')