ABI Check

This commit is contained in:
mayeut 2015-10-09 21:20:54 +02:00
parent 1b2ebfc69a
commit a7ae153a46
2 changed files with 44 additions and 25 deletions

View File

@ -2,7 +2,6 @@
"Name": "openjpeg",
"Title": "OpenJPEG",
"SourceUrl": "https://github.com/uclouvain/openjpeg/tags",
"Git": "https://github.com/uclouvain/openjpeg.git",
"Maintainer": "Antonin D.",
"MaintainerUrl": "http://www.openjpeg.org/",
"Package": "version.",
@ -11,7 +10,7 @@
{
"Number": "current",
"Installed": "installed/openjpeg/current",
"Source": "@OPJ_SRC_DIR@",
"Source": "src/openjpeg/current",
"Changelog": "On",
"HeadersDiff": "On",
"PkgDiff": "Off",

View File

@ -13,18 +13,22 @@ if [ "${OPJ_CI_ABI_CHECK:-}" != "1" ]; then
exit 0
fi
OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd)
if [ ! -d ${HOME}/abi-check ]; then
mkdir ${HOME}/abi-check
OPJ_UPLOAD_ABI_REPORT=0
OPJ_LIMIT_ABI_BUILDS="-limit 2"
if [ "${TRAVIS_REPO_SLUG:-}" != "" ]; then
if [ "$(echo "${TRAVIS_REPO_SLUG}" | sed 's/\(^.*\)\/.*/\1/')" == "uclouvain" ] && [ "${TRAVIS_PULL_REQUEST:-}" == "false" ]; then
# Upload report
OPJ_UPLOAD_ABI_REPORT=1
# Build full report
OPJ_LIMIT_ABI_BUILDS=
fi
fi
cd ${HOME}/abi-check
OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd)
if [ ! -f ${HOME}/abi-check/.restored ]; then
# Clean all if .restored is not present
touch not.empty
rm -rf ./*
mkdir ${HOME}/abi-check
cd ${HOME}/abi-check
# Let's get tools not available with apt
mkdir tools
wget -qO - https://tools.ietf.org/tools/rfcdiff/rfcdiff-1.42.tgz | tar -xz
@ -32,14 +36,30 @@ if [ ! -f ${HOME}/abi-check/.restored ]; then
wget -qO - https://github.com/lvc/installer/archive/0.2.tar.gz | tar -xz
mkdir ${PWD}/tools/abi-tracker
make -C installer-0.2 install prefix=${PWD}/tools/abi-tracker target=abi-tracker
rm -rf installer-0.2
export PATH=${PWD}/tools/rfcdiff:${PWD}/tools/abi-tracker/bin:$PATH
mkdir tracker
fi
cp -f ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json ./tracker/openjpeg.json
cd tracker
# Check ABI
export PATH=${PWD}/../tools/rfcdiff:${PWD}/../tools/abi-tracker/bin:$PATH
sed -e "s/@OPJ_SOURCE_DIR@/${OPJ_SOURCE_DIR//\//\\/}/g" ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json > openjpeg.json
abi-monitor -get openjpeg.json
abi-monitor -build openjpeg.json
# Let's create all we need
abi-monitor ${OPJ_LIMIT_ABI_BUILDS} -get openjpeg.json
cp -rf ${OPJ_SOURCE_DIR} src/openjpeg/current
abi-monitor ${OPJ_LIMIT_ABI_BUILDS} -build openjpeg.json
abi-tracker -build openjpeg.json
EXIT_CODE=0
# Check API
abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/2.1 -name '*.dump') -new $(find ./abi_dump/openjpeg/current -name '*.dump') -header openjpeg.h -api -s || EXIT_CODE=1
# Check ABI
abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/2.1 -name '*.dump') -new $(find ./abi_dump/openjpeg/current -name '*.dump') -header openjpeg.h -abi -s || EXIT_CODE=1
rm -rf src installed
if [ ${OPJ_UPLOAD_ABI_REPORT} -eq 1 ]; then
echo "TODO: Where to upload the report"
fi
exit $EXIT_CODE