extlibs/libcoap/libcoap
extlibs/gtest/gtest-*
extlibs/hippomocks-master/
+extlibs/hippomocks/hippomocks/
extlibs/master.zip
extlibs/cereal/cereal
extlibs/cereal
src_dir = env.get('SRC_DIR')
if target_os in ['linux', 'windows']:
- print '*** Checking for installation of hippomocks ***'
-
- hippomocks_sha = '8e210c5808d490b26fff69151c801fa28d291fcb'
- hippomocks_dir_src = src_dir + '/extlibs/hippomocks-' + hippomocks_sha
- hippomocks_dir_dest = src_dir + '/extlibs/hippomocks-master'
- hippomocks_zip_file = src_dir + '/extlibs/hippomocks-' + hippomocks_sha + '.zip'
- hippomocks_url = 'https://github.com/dascandy/hippomocks/archive/' + hippomocks_sha + '.zip'
-
- if not os.path.exists(hippomocks_dir_dest):
- # If the hippomocks zip file is not already present, download it
- if not os.path.exists(hippomocks_zip_file):
- hippomocks_zip = env.Download(hippomocks_zip_file, hippomocks_url)
- else:
- hippomocks_zip = hippomocks_zip_file
-
- # Unzip hippomocks
- print 'Unzipping hippomocks'
- env.UnpackAll(hippomocks_dir_src, hippomocks_zip)
- print 'Renaming hippomocks directory'
- os.rename(hippomocks_dir_src, hippomocks_dir_dest)
-
-
-
+ print '*** Checking for installation of hippomocks ***'
+ hippomocks_version = '5.0'
+ hippomocks_revision = 'v' + hippomocks_version
+ hippomocks_src_dir = src_dir + '/extlibs/hippomocks/hippomocks-' + hippomocks_version
+ hippomocks_dest_dir = src_dir + '/extlibs/hippomocks/hippomocks'
+ hippomocks_zip_file = src_dir + '/extlibs/hippomocks/' + hippomocks_revision + '.zip'
+ hippomocks_url = 'https://github.com/dascandy/hippomocks/archive/' + hippomocks_revision + '.zip'
+ if not os.path.exists(hippomocks_dest_dir):
+ if not os.path.exists(hippomocks_zip_file):
+ hippomocks_zip = env.Download(hippomocks_zip_file, hippomocks_url)
+ else:
+ hippomocks_zip = hippomocks_zip_file
+ print 'hippomocks: Unzipping %s to %s' % (hippomocks_zip_file, hippomocks_dest_dir)
+ env.UnpackAll(hippomocks_src_dir, hippomocks_zip)
+ os.rename(hippomocks_src_dir, hippomocks_dest_dir)
--- /dev/null
+#!/bin/bash
+#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+#
+# 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.
+#
+#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+
+set -e
+
+[ ! -z ${EXEC_MODE} ] || EXEC_MODE=false
+
+topdir="${PWD}"
+
+# Keep packageRevision in sync with extlibs/tinycbor/SConscript's setting
+# Right now this script assumes packageRevision is a tag;
+# comment out the second clause
+# if packageRevision becomes a branch or a specific commit.
+package="hippomocks"
+packageUrl="https://github.com/dascandy/hippomocks"
+packageDir="./extlibs/${package}/${package}"
+packageRevision="v5.0"
+
+
+do_()
+{
+ set +f
+ if $EXEC_MODE; then
+ echo "warning: fetching online resources may not be reproductible"
+ printf "%s \n" "trying: \"$@\""
+ eval "$@"
+ else
+cat<<EOF
+error: Something should be prepared, please manually execute from shell
+EOF
+ printf "%s \n" "$@"
+ exit 1
+ fi
+}
+
+
+main_()
+{
+ if [ ! -d "${packageDir}" ]; then
+ do_ "git clone ${packageUrl} ${packageDir} -b ${packageRevision}"
+ elif [ ! -z $(git tag -l "${packageRevision}") ]; then
+ cat<<EOF
+error: $packageDir is unaligned with supported release of ${package}
+Please update ${package} using "cd ${packageDir} && git fetch"
+For more support please refer to:
+https://wiki.iotivity.org/build
+EOF
+ exit 2
+ elif [ -d "${packageDir}/.git" ]; then
+ cd "${packageDir}"
+ git reset --hard "${packageRevision}"
+ cd -
+ rm -rf -- "${packageDir}/.git"
+ else
+ echo "log: Assuming ${package} is already on correct revision: \"${packageRevision}\""
+ fi
+}
+
+
+main_ "$@"
+
SConscript('#resource/third_party_libs.scons', 'lib_env')
if target_os in ['linux']:
- # Verify that 'hippomocks' mocking code is installed. If not,
- # get it and install it
- SConscript('#extlibs/hippomocks.scons')
+ SConscript('#extlibs/hippomocks/SConscript')
rd_test_env = lib_env.Clone()
######################################################################
rd_test_env.AppendUnique(
CPPPATH = [
- src_dir + '/extlibs/hippomocks-master',
+ src_dir + '/extlibs/hippomocks/hippomocks',
'../include',
src_dir + '/resource/include',
src_dir + '/resource/csdk/connectivity/api',
'../../csdk/ocrandom/include',
'../../csdk/logger/include',
'../../csdk/connectivity/lib/libcoap-4.1.1/include',
- '../../../extlibs/hippomocks-master/HippoMocks',
- '../../../extlibs/hippomocks-master/HippoMocksTest'
+ '../../../extlibs/hippomocks/hippomocks/',
+ '../../../extlibs/hippomocks/hippomocks/'
])
provisiontests_env.PrependUnique(LIBS = [
if target_os in ['linux', 'windows']:
# Verify that 'hippomocks' mocking code is installed. If not,
# get it and install it
- SConscript('#extlibs/hippomocks.scons')
+ SConscript('#extlibs/hippomocks/SConscript')
# Build Common unit tests
SConscript('c_common/unittests/SConscript', 'test_env')
'../csdk/ocsocket/include',
'../c_common/ocrandom/include',
'../csdk/logger/include',
- '#extlibs/hippomocks-master/HippoMocks',
- '#extlibs/hippomocks-master/HippoMocksTest'
+ '#extlibs/hippomocks/hippomocks',
])
if target_os in ['windows']:
CoAP_test_env.PrependUnique(LIBS = ['gcov'])
CoAP_test_env.AppendUnique(CXXFLAGS = ['--coverage'])
-CoAP_test_env.AppendUnique(CPPPATH = [src_dir + '/extlibs/hippomocks-master',
+CoAP_test_env.AppendUnique(CPPPATH = ['#/extlibs/hippomocks/hippomocks',
'../include',
os.path.join(src_dir, 'resource/csdk/include'),
os.path.join(src_dir, 'resource/csdk/stack/include'),
easysetup_test_env.AppendUnique(LIBS = ['pthread'])
easysetup_test_env.PrependUnique(CPPPATH = [
- '#/extlibs/hippomocks-master',
+ '#/extlibs/hippomocks/hippomocks',
gtest_dir + '/include',
'#/resource/include',
'#/resource/csdk/connectivity/api',
easysetup_test_env.AppendUnique(LIBS = ['pthread'])
easysetup_test_env.PrependUnique(CPPPATH = [
- '#/extlibs/hippomocks-master',
+ '#/extlibs/hippomocks/hippomocks',
gtest_dir + '/include',
'#/resource/csdk/include',
'#/resource/csdk/connectivity/api',
notification_wrapper_test_env.AppendUnique(LIBS = ['pthread'])
notification_wrapper_test_env.PrependUnique(CPPPATH = [
- '#/extlibs/hippomocks-master',
+ '#/extlibs/hippomocks/hippomocks',
gtest_dir + '/include',
'../provider/inc',
'../consumer/inc',
notification_test_env.AppendUnique(CXXFLAGS = ['-pthread'])
notification_test_env.AppendUnique(LIBS = ['pthread'])
-notification_test_env.PrependUnique(CPPPATH = [ src_dir + '/extlibs/hippomocks-master', gtest_dir + '/include'])
+notification_test_env.PrependUnique(CPPPATH = [ '#/extlibs/hippomocks/hippomocks', gtest_dir + '/include'])
notification_test_env.AppendUnique(CPPPATH = ['../include'])
notification_test_env.AppendUnique(CPPPATH = ['../src/consumer'])
notification_test_env.AppendUnique(CPPPATH = ['../src/provider'])
container_gtest_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
container_gtest_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log'])
-container_gtest_env.PrependUnique(CPPPATH = [src_dir + '/extlibs/hippomocks-master'])
+container_gtest_env.PrependUnique(CPPPATH = ['#/extlibs/hippomocks/hippomocks'])
if int(containerJavaSupport):
try:
rcs_common_test_env = rcs_common_env.Clone();
rcs_common_test_env.PrependUnique(CPPPATH = [
- rcs_common_test_env.get('SRC_DIR')+'/extlibs/hippomocks-master',
+ '#/extlibs/hippomocks/hippomocks',
'utils/include'
])
'#/resource/oc_logger/include'
])
-broker_test_env.PrependUnique(CPPPATH = [broker_test_env.get('SRC_DIR')+'/extlibs/hippomocks-master'])
+broker_test_env.PrependUnique(CPPPATH = ['#/extlibs/hippomocks/hippomocks'])
broker_test_env.AppendUnique(LIBPATH = [broker_test_env.get('BUILD_DIR')])
broker_test_env.PrependUnique(LIBS = ['coap'])
'#/resource/include',
'#/resource/oc_logger/include'
])
-cache_test_env.PrependUnique(CPPPATH = [cache_test_env.get('SRC_DIR')+'/extlibs/hippomocks-master'])
+cache_test_env.PrependUnique(CPPPATH = ['#/extlibs/hippomocks/hippomocks'])
cache_test_env.AppendUnique(LIBPATH = [cache_test_env.get('BUILD_DIR')])
cache_test_env.PrependUnique(LIBS = ['rcs_client', 'rcs_common',
'oc', 'octbstack', 'oc_logger',
server_builder_test_env = server_builder_env.Clone();
server_builder_test_env.AppendUnique(CPPPATH = [
- server_builder_test_env.get('SRC_DIR')+'/extlibs/hippomocks-master',
+ '#/extlibs/hippomocks/hippomocks',
'../common/utils/include'
])
SConscript('#service/third_party_libs.scons', 'lib_env')
if target_os in ['linux']:
- # Verify that 'hippomocks' mocking code is installed. If not,
- # get it and install it
- SConscript('#extlibs/hippomocks.scons')
+ SConscript('#extlibs/hippomocks/SConscript')
rcs_test_env = lib_env.Clone()
######################################################################
rcs_test_env.AppendUnique(
CPPPATH = [
- '#/extlibs/hippomocks-master',
+ '#/extlibs/hippomocks/hippomocks',
'../include',
'../src/common/utils/include',
'#/resource/csdk/include',
scene_test_env.AppendUnique(CXXFLAGS = ['--coverage'])
scene_test_env.PrependUnique(CPPPATH = [
- '#/extlibs/hippomocks-master',
+ '#/extlibs/hippomocks/hippomocks',
'../include',
'../src',
'#/service/resource-encapsulation/include',