IOT-1583: Removing /W4 warning from resource/c_common.
[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 if target_os in ['linux', 'windows', 'darwin', 'msys_nt']:
31     # Verify that 'google unit test' library is installed.  If not,
32     # get it and install it
33     test_env = SConscript('#extlibs/gtest/SConscript')
34
35     if target_os in ['linux', 'windows']:
36         # Verify that 'hippomocks' mocking code is installed.  If not,
37         # get it and install it
38         SConscript('#extlibs/hippomocks.scons')
39
40         # Build Common unit tests
41         SConscript('c_common/unittests/SConscript', 'test_env')
42
43         # Build C++ unit tests
44         SConscript('unittests/SConscript', 'test_env')
45
46         # Build Security Resource Manager and Provisioning API unit test
47         # TODO: Enable provisioning and associated unit tests for Windows
48         if (env.get('SECURED') == '1') and (target_os != 'windows'):
49             SConscript('provisioning/unittests/SConscript', 'test_env')
50
51     # Build C unit tests
52     SConscript('csdk/unittests/SConscript', 'test_env')