mbedtls: Update to mbedtls-2.4.2
[platform/upstream/iotivity.git] / resource / unit_tests.scons
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 ##
22 # 'unit_tests' script for building unit tests and libs
23 #
24 ##
25
26 Import('env')
27
28 target_os = env.get('TARGET_OS')
29
30 build_tests = False
31
32 if target_os in ['windows']:
33     # gtest has a lot of windows native/desktop only APIs. As all unit tests depend on gtest,
34     # only enable unit tests if building for Win32.
35     if env.get('MSVC_UWP_APP') != '1':
36         build_tests = True
37 elif target_os in ['darwin', 'linux', 'msys_nt']:
38     build_tests = True
39
40 if build_tests:
41     # Verify that 'google unit test' library is installed.  If not,
42     # get it and install it
43     test_env = SConscript('#extlibs/gtest/SConscript')
44
45     if target_os in ['linux', 'windows']:
46         # Verify that 'hippomocks' mocking code is installed.  If not,
47         # get it and install it
48         SConscript('#extlibs/hippomocks/SConscript')
49
50         # Build Common unit tests
51         SConscript('c_common/unittests/SConscript', 'test_env')
52
53         # Build C++ unit tests
54         SConscript('unittests/SConscript', 'test_env')
55
56         # Build Security Resource Manager and Provisioning API unit test
57         if env.get('SECURED') == '1':
58             SConscript('provisioning/unittests/SConscript', 'test_env')
59
60         # Build IPCA unit tests
61         SConscript('IPCA/unittests/SConscript', 'test_env')
62
63     # Build C unit tests
64     SConscript('csdk/unittests/SConscript', 'test_env')