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_tests' script for building unit tests and libs
28 target_os = env.get('TARGET_OS')
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':
37 elif target_os in ['darwin', 'linux', 'msys_nt']:
41 # Verify that 'google unit test' library is installed. If not,
42 # get it and install it
43 test_env = SConscript('#extlibs/gtest/SConscript')
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')
50 # Build Common unit tests
51 SConscript('c_common/unittests/SConscript', 'test_env')
53 # Build C++ unit tests
54 SConscript('unittests/SConscript', 'test_env')
56 # Build Security Resource Manager and Provisioning API unit test
57 if env.get('SECURED') == '1':
58 SConscript('provisioning/unittests/SConscript', 'test_env')
60 # Build IPCA unit tests
61 SConscript('IPCA/unittests/SConscript', 'test_env')
64 SConscript('csdk/unittests/SConscript', 'test_env')