[debian-mysql] [PATCH 2/8] Add dep8 tests
Robie Basak
robie.basak at canonical.com
Mon Feb 10 13:50:15 UTC 2014
---
debian/control | 1 +
debian/tests/build | 35 +++++++++++++++++++++++++++++++++++
debian/tests/control | 5 +++++
debian/tests/upstream | 25 +++++++++++++++++++++++++
4 files changed, 66 insertions(+)
create mode 100755 debian/tests/build
create mode 100644 debian/tests/control
create mode 100755 debian/tests/upstream
diff --git a/debian/control b/debian/control
index b30eab9..3f5cb47 100644
--- a/debian/control
+++ b/debian/control
@@ -29,6 +29,7 @@ Standards-Version: 3.9.5
Homepage: http://dev.mysql.com/
Vcs-Git: git://git.debian.org/git/pkg-mysql/mysql-5.5.git
Vcs-Browser: http://git.debian.org/?p=pkg-mysql/mysql-5.5.git
+XS-Testsuite: autopkgtest
Package: libmysqlclient18
Section: libs
diff --git a/debian/tests/build b/debian/tests/build
new file mode 100755
index 0000000..e88bd22
--- /dev/null
+++ b/debian/tests/build
@@ -0,0 +1,35 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against libmysqlclient, to verify that the
+# headers and pkg-config file are installed correctly
+# (C) 2012 Canonical Ltd.
+# Author: Daniel Kessel <d.kessel at gmx.de>
+
+echo "test 'build' starting"
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+
+cat <<EOF > libmysqltest.c
+#include <stdio.h>
+#include <mysql.h>
+
+int main()
+{
+ if (mysql_library_init(0, NULL, NULL)) {
+ fprintf(stderr, "failed to initialize mysql client library\n");
+ return 1;
+ }
+
+ mysql_library_end();
+ return 0;
+}
+EOF
+
+echo "building..."
+gcc -o libmysqltest libmysqltest.c `/usr/bin/mysql_config --cflags --libs` -Wall -Werror
+echo "build: OK"
+[ -x libmysqltest ]
+./libmysqltest
+echo "run: OK"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..6d40efa
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,5 @@
+Tests: build
+Depends: libmysqlclient-dev, build-essential
+
+Tests: upstream
+Depends: mysql-testsuite
diff --git a/debian/tests/upstream b/debian/tests/upstream
new file mode 100755
index 0000000..be7c768
--- /dev/null
+++ b/debian/tests/upstream
@@ -0,0 +1,25 @@
+#!/bin/sh
+# autopkgtest check: Build and run the upstream test suite.
+# (C) 2012 Canonical Ltd.
+# Author: Daniel Kessel <d.kessel at gmx.de>
+
+# running the mysql testsuite as described in:
+# https://bugs.launchpad.net/ubuntu/+source/mysql-5.5/+bug/959683
+
+echo "running test 'testsuite'"
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+
+mkdir var
+mkdir tmp
+
+echo "using vardir: $WORKDIR/var"
+echo "using tmpdir: $WORKDIR/tmp"
+
+cd /usr/lib/mysql-testsuite
+echo "starting mysql-test-tun.pl..."
+./mysql-test-run.pl --force --vardir=$WORKDIR/var --tmpdir=$WORKDIR/tmp --comment=normal --timer --skip-ndbcluster --report-features 2>&1
+echo "run: OK"
--
1.8.3.2
More information about the pkg-mysql-maint
mailing list