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 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
24 unittests_env = env.Clone()
26 src_dir = unittests_env.get('SRC_DIR')
27 pi_dir = os.path.join(src_dir, 'plugins')
28 build_dir = env.get('BUILD_DIR')
29 ######################################################################
31 ######################################################################
32 unittests_env.PrependUnique(CPPPATH = [
33 os.path.join(pi_dir, 'include'),
34 '#extlibs/gtest/gtest-1.7.0/include',
37 unittests_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
38 unittests_env.PrependUnique(LIBS = ['-lpthread'])
39 unittests_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
40 unittests_env.AppendUnique(LIBPATH = [os.path.join(src_dir, 'extlibs', 'gtest', 'gtest-1.7.0', 'lib', '.libs')])
41 unittests_env.PrependUnique(LIBS = [
46 'connectivity_abstraction',
52 if env.get('LOGGING'):
53 unittests_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
55 ######################################################################
56 # Source files and Targets
57 ######################################################################
58 piunittests = unittests_env.Program('piunittests', ['plugininterfacetest.cpp'])
60 Alias("piunittests", [piunittests])
62 env.AppendTarget('piunittests')
63 if env.get('TEST') == '1':
64 target_os = env.get('TARGET_OS')
65 if target_os == 'linux':
66 from tools.scons.RunTest import *
67 run_test(unittests_env,
68 'plugins_unittests.memcheck',
69 'plugins/unittests/piunittests')