14b13e2c886a80defe8587bb223fa92608cb8a6d
[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_test' script for building unit tests and libs
23 #
24 ##
25
26 Import('env')
27
28 target_os = env.get('TARGET_OS')
29 src_dir = env.get('SRC_DIR')
30 build_dir = env.get('BUILD_DIR')
31
32 if target_os == 'linux':
33         # Verify that 'google unit test' library is installed.  If not,
34         # get it and install it
35         SConscript(src_dir + '/extlibs/gtest/SConscript')
36
37         # Verify that 'hippomocks' mocking code is installed.  If not,
38         # get it and install it
39         SConscript(src_dir + '/extlibs/hippomocks.scons')
40
41     # Build Common unit tests
42         SConscript('c_common/oic_string/test/SConscript')
43         SConscript('c_common/oic_malloc/test/SConscript')
44
45         # Build C unit tests
46         SConscript('csdk/stack/test/SConscript')
47         SConscript('csdk/ocrandom/test/SConscript')
48
49         SConscript('csdk/connectivity/test/SConscript')
50
51         # Build Security Resource Manager unit tests
52         SConscript('csdk/security/unittest/SConscript')
53
54         # Build C++ unit tests
55         SConscript('unittests/SConscript')
56
57         # Build Provisioning API unit test
58         if env.get('SECURED') == '1':
59                 SConscript('csdk/security/provisioning/unittest/SConscript')
60
61 elif target_os == 'darwin':
62         # Verify that 'google unit test' library is installed.  If not,
63         # get it and install it
64         SConscript(src_dir + '/extlibs/gtest/SConscript')
65
66         # Build C stack's unit tests.
67         SConscript('csdk/stack/test/SConscript')
68         SConscript('csdk/connectivity/test/SConscript')
69
70