diff mbox

[rdma-core,3/5] buildlib: add script to check ABI

Message ID b56b8c48-d1c8-6754-fe9b-897dd931fbf9@suse.de (mailing list archive)
State Superseded
Headers show

Commit Message

Nicolas Morey-Chaisemartin Nov. 14, 2017, 6:59 p.m. UTC
Add travis-checkabi which generates a dump of all rdma-core libraries
ABI and checks them against a ref if they exists.

Signed-off-by: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com>
Cc: stable@linux-rdma.org # v15
---
 buildlib/travis-checkabi | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100755 buildlib/travis-checkabi
diff mbox

Patch

diff --git a/buildlib/travis-checkabi b/buildlib/travis-checkabi
new file mode 100755
index 00000000..7afa3b59
--- /dev/null
+++ b/buildlib/travis-checkabi
@@ -0,0 +1,28 @@ 
+#!/bin/bash
+
+# Stop on error
+set -e
+# Echo all commands to Travis log
+set -x
+
+REF_DIR=buildlib/ABI
+NEW_DIR=build-abi/ABI
+
+./buildlib/gen-abi
+
+# Current ABI not available !
+if [ ! -d $NEW_DIR ]; then
+	echo "ERROR: Missing ABI description files" >&2
+	exit 1
+fi
+# No reference ABI to match against.
+if [ ! -d $REF_DIR ]; then
+	echo "INFO: Skipping ABI check. No reference available"
+	exit 0
+fi
+
+for FILE in $(find $NEW_DIR -name "*.dump"); do 
+	DUMP=$(basename $FILE)
+	LIBNAME=$(echo $DUMP | sed -e 's/\(.*\).so.*/\1/')
+	./buildlib/abi-checker/abi-compliance-checker.pl -l $LIBNAME -old $REF_DIR/$DUMP -new $NEW_DIR/$DUMP
+done