1 #******************************************************************
3 # Copyright 2014 Intel Mobile Communications GmbH 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 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 # 'unit_test' script for building unit tests and libs
28 target_os = env.get('TARGET_OS')
29 src_dir = env.get('SRC_DIR')
30 build_dir = env.get('BUILD_DIR')
32 if target_os in ['linux']:
33 # Verify that 'google unit test' library is installed. If not,
34 # get it and install it
35 SConscript('#extlibs/gtest/SConscript')
37 # Verify that 'hippomocks' mocking code is installed. If not,
38 # get it and install it
39 SConscript('#extlibs/hippomocks.scons')
41 # Build Common unit tests
42 SConscript('c_common/oic_string/test/SConscript')
43 SConscript('c_common/oic_malloc/test/SConscript')
44 SConscript('c_common/oic_time/test/SConscript')
45 SConscript('c_common/ocrandom/test/SConscript')
46 SConscript('c_common/ocevent/test/SConscript')
49 SConscript('csdk/stack/test/SConscript')
51 SConscript('csdk/connectivity/test/SConscript')
53 # Build Security Resource Manager unit tests
54 if env.get('SECURED') == '1':
55 SConscript('csdk/security/unittest/SConscript')
57 # Build C++ unit tests
58 SConscript('unittests/SConscript')
60 # Build Provisioning API unit test
61 if env.get('SECURED') == '1':
62 SConscript('csdk/security/provisioning/unittest/SConscript')
63 SConscript('provisioning/unittests/SConscript')
65 elif target_os == 'windows' and env.get('TEST') == '1':
66 # Verify that 'google unit test' library is installed. If not,
67 # get it and install it
68 SConscript('#extlibs/gtest/SConscript')
70 # Build Common unit tests
71 SConscript('c_common/windows/test/SConscript')
73 # Build C stack's unit tests.
74 SConscript('csdk/stack/test/SConscript')
75 SConscript('csdk/connectivity/test/SConscript')
77 # Build Security Resource Manager unit tests
78 if env.get('SECURED') == '1':
79 SConscript('csdk/security/unittest/SConscript')
81 # Build Provisioning API unit test
82 if env.get('SECURED') == '1':
83 SConscript('csdk/security/provisioning/unittest/SConscript')
85 elif target_os in ['darwin', 'msys_nt']:
86 # Verify that 'google unit test' library is installed. If not,
87 # get it and install it
88 SConscript('#extlibs/gtest/SConscript')
90 # Build C stack's unit tests.
91 SConscript('csdk/stack/test/SConscript')
92 SConscript('csdk/connectivity/test/SConscript')