IOT-1583: Removing /W4 warning from resource/c_common.
[platform/upstream/iotivity.git] / resource / c_common / ocrandom / test / SConscript
1 #******************************************************************
2 #
3 # Copyright 2014 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 import os
22 import os.path
23 from tools.scons.RunTest import *
24
25 Import('test_env')
26
27 # SConscript file for Local PKI google tests
28 randomtest_env = test_env.Clone()
29 target_os = randomtest_env.get('TARGET_OS')
30
31 ######################################################################
32 # Build flags
33 ######################################################################
34
35 randomtest_env.PrependUnique(CPPPATH = [
36         '../include',
37                '../../logger/include',
38                '../../../oc_logger/include',
39                ])
40  
41 randomtest_env.AppendUnique(LIBPATH = [randomtest_env.get('BUILD_DIR')])
42 randomtest_env.PrependUnique(LIBS = ['octbstack',
43                                       'connectivity_abstraction',
44                                       'uuid'])
45
46 randomtest_env.PrependUnique(CPPPATH = ['../include'])
47
48 randomtest_env.PrependUnique(LIBS = ['c_common'])
49
50 if target_os in ['linux']:
51     randomtest_env.AppendUnique(LIBS = ['m'])
52
53 #if randomtest_env.get('SECURED') == '1':
54 #       randomtest_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
55
56 if randomtest_env.get('LOGGING'):
57         randomtest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
58
59 ######################################################################
60 # Source files and Targets
61 ######################################################################
62 randomtests = randomtest_env.Program('randomtests', ['randomtest.cpp'])
63
64 Alias("test", [randomtests])
65
66 randomtest_env.AppendTarget('test')
67 if randomtest_env.get('TEST') == '1':
68         if target_os in ['linux', 'windows']:
69                 run_test(randomtest_env,
70                          'resource_csdk_random_test.memcheck',
71                          'resource/c_common/ocrandom/test/randomtests')