#****************************************************************** # # Copyright 2014 Intel Mobile Communications GmbH 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. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= import os import os.path # SConscript file for Local PKI google tests gtest_env = SConscript('#extlibs/gtest/SConscript') stacktest_env = gtest_env.Clone() src_dir = stacktest_env.get('SRC_DIR') target_os = stacktest_env.get('TARGET_OS') ###################################################################### # Build flags ###################################################################### stacktest_env.PrependUnique(CPPPATH = [ '../../security/include', '../../ocsocket/include', '../../logger/include', '../../../c_common/ocrandom/include', '../../stack/include', '../../stack/include/internal', '../../connectivity/api', '../../connectivity/external/inc', '../../extlibs/cjson', '../../../oc_logger/include', ]) if target_os not in ['windows']: stacktest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) stacktest_env.AppendUnique(LIBPATH = [stacktest_env.get('BUILD_DIR')]) stacktest_env.PrependUnique(LIBS = ['octbstack', 'ocsrm', 'connectivity_abstraction', 'coap', 'gtest', 'gtest_main']) if target_os != 'darwin': stacktest_env.PrependUnique(LIBS = ['oc_logger']) if stacktest_env.get('SECURED') == '1': stacktest_env.AppendUnique(LIBS = ['tinydtls']) if stacktest_env.get('LOGGING'): stacktest_env.AppendUnique(CPPDEFINES = ['TB_LOG']) if target_os not in ['msys_nt', 'windows']: stacktest_env.PrependUnique(LIBS = ['m']) stacktest_env.PrependUnique(LIBS = ['pthread']) ###################################################################### # Source files and Targets ###################################################################### stacktests = stacktest_env.Program('stacktests', ['stacktests.cpp']) cbortests = stacktest_env.Program('cbortests', ['cbortests.cpp']) Alias("test", [stacktests, cbortests]) stacktest_env.AppendTarget('test') if stacktest_env.get('TEST') == '1': if target_os in ['linux']: from tools.scons.RunTest import * run_test(stacktest_env, 'resource_csdk_stack_test.memcheck', 'resource/csdk/stack/test/stacktests')