#****************************************************************** # # Copyright 2015 Samsung Electronics All Rights Reserved. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ## # ResourceHosting Unit Test build script ## # SConscript file for Local PKI google tests gtest_env = SConscript('#extlibs/gtest/SConscript') lib_env = gtest_env.Clone() if lib_env.get('RELEASE'): lib_env.AppendUnique(CCFLAGS = ['-Os']) lib_env.AppendUnique(CPPDEFINES = ['NDEBUG']) else: lib_env.AppendUnique(CCFLAGS = ['-g']) if lib_env.get('LOGGING'): lib_env.AppendUnique(CPPDEFINES = ['TB_LOG']) SConscript('#service/third_party_libs.scons', 'lib_env') ###################################################################### #unit test setting ###################################################################### src_dir = lib_env.get('SRC_DIR') hosting_test_env = lib_env.Clone() target_os = hosting_test_env.get('TARGET_OS') ###################################################################### # Build flags ###################################################################### hosting_test_env.AppendUnique(LIBPATH = [hosting_test_env.get('BUILD_DIR')]) hosting_test_env.AppendUnique(LIBS = [ 'resource_hosting', 'rcs_server', 'rcs_client','rcs_common', 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', 'gtest_main', 'gtest']) if target_os not in ['windows', 'winrt']: hosting_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x']) if target_os in ['linux']: hosting_test_env.AppendUnique(CXXFLAGS = ['-pthread']) hosting_test_env.AppendUnique(LIBS = ['pthread']) hosting_test_env.PrependUnique(CPPPATH = [ src_dir + '/extlibs/hippomocks-master']) hosting_test_env.AppendUnique(CPPPATH = ['../src']) hosting_test_env.AppendUnique(CPPPATH = ['../../resource-encapsulation/include']) hosting_test_env.AppendUnique(CPPPATH = ['../../resource-encapsulation/src/common/primitiveResource/include']) hosting_test_env.AppendUnique(CPPPATH = ['../../resource-encapsulation/src/common/utils/include']) ###################################################################### # Build Test ###################################################################### hosting_test_src = hosting_test_env.Glob('./*.cpp') hosting_test = hosting_test_env.Program('hosting_test', hosting_test_src) Alias("hosting_test", hosting_test) hosting_test_env.AppendTarget('hosting_test') if hosting_test_env.get('TEST') == '1': target_os = hosting_test_env.get('TARGET_OS') if target_os in ['linux']: from tools.scons.RunTest import * run_test(hosting_test_env, '', 'service/resource-hosting/unittest/hosting_test')