[librsvg/cargo-c: 22/25] Extremely basic script to test the cargo-c artifacts




commit c6215dc0d34009130f4b69ebaedfebc01ee24e91
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Jul 2 19:33:55 2021 -0500

    Extremely basic script to test the cargo-c artifacts

 test-cargo-c.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
---
diff --git a/test-cargo-c.sh b/test-cargo-c.sh
new file mode 100644
index 00000000..d4a6c676
--- /dev/null
+++ b/test-cargo-c.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+# This script assumes that "cargo cbuild" has been run already.
+
+set -e
+
+TARGET=target/x86_64-unknown-linux-gnu/debug
+
+# FIXME: cargo-c renames the .so to .so.x.y.z on installation
+# LIBRARY=librsvg-2.so.2.51.3
+LIBRARY=librsvg-2.so
+
+if [ ! -f $TARGET/$LIBRARY ]
+then
+    echo "error: $LIBRARY does not exist"
+    exit 1
+fi
+
+if (objdump -p $TARGET/$LIBRARY | grep '  SONAME               librsvg-2.so.2')
+then
+    true
+else
+    echo "error: wrong SONAME"
+    exit 1
+fi
+
+if [ ! -f $TARGET/librsvg-2.0.pc ]
+then
+    echo "error: missing librsvg-2.0.pc"
+    exit 1
+fi
+
+if grep "Name: librsvg" librsvg-2.0.pc
+then
+    true
+else
+    echo "error: wrong Name in librsvg-2.0.pc"
+    exit 1
+fi
+
+if grep 'Cflags: -I${includedir}/librsvg-2.0' librsvg-2.0.pc
+then
+    true
+else
+    echo "error: wrong Cflags in librsvg-2.0.pc"
+    exit 1
+fi
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]