[libtheora] 01/02: Added simple autopkgtest script to verify that building and linking work.

Petter Reinholdtsen pere at moszumanska.debian.org
Tue May 24 13:24:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

pere pushed a commit to annotated tag debian/1.1.1+dfsg.1-9
in repository libtheora.

commit 2112e6f91347b64a14fbbd7faec13515c000eaee
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Tue May 24 15:22:24 2016 +0200

    Added simple autopkgtest script to verify that building and linking work.
---
 debian/tests/control                |  2 ++
 debian/tests/test-build-examples    | 40 +++++++++++++++++++++++++++++++++++++
 debian/tests/test-simple-build-link | 38 +++++++++++++++++++++++++++++++++++
 3 files changed, 80 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..7af7240
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: test-simple-build-link
+Depends: @
diff --git a/debian/tests/test-build-examples b/debian/tests/test-build-examples
new file mode 100644
index 0000000..9140555
--- /dev/null
+++ b/debian/tests/test-build-examples
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+set -e
+at_exit() {
+    set +x
+    echo "info: test exiting, removing $WORKDIR"
+    rm -rf $WORKDIR
+}
+WORKDIR=$(mktemp -d)
+trap at_exit INT TERM EXIT
+set -x
+
+cd $WORKDIR
+
+# This is just a simple code example to compile to verify the headers
+# exist, are includable and the library is linkable.  It should be
+# extended to really use the library to test a bit more of the
+# package.
+cat <<EOF > example.c
+#include <string.h>
+#include <stdio.h>
+#include <theora/theoradec.h>
+#include <vorbis/codec.h>
+int main(int argc, char *argv[])
+{
+  static th_info ti;
+
+  /* quiet down compiler about unused arguments */
+  if (1 < argc)
+      return (strlen(argv[1]) != 0);
+  th_info_init(&ti);    
+
+  printf("info: program ran as it should\n");
+  return (0);
+}
+EOF
+
+gcc -o test -Wall -Wextra example.c -ltheoradec
+
+./test
diff --git a/debian/tests/test-simple-build-link b/debian/tests/test-simple-build-link
new file mode 100755
index 0000000..3a5a25d
--- /dev/null
+++ b/debian/tests/test-simple-build-link
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+set -e
+at_exit() {
+    set +x
+    echo "info: test exiting, removing $WORKDIR"
+    rm -rf $WORKDIR
+}
+WORKDIR=$(mktemp -d)
+trap at_exit INT TERM EXIT
+set -x
+
+cd $WORKDIR
+
+# This is just a simple code example to compile to verify the headers
+# exist, are includable and the library is linkable.
+cat <<EOF > example.c
+#include <string.h>
+#include <stdio.h>
+#include <theora/theoradec.h>
+#include <vorbis/codec.h>
+int main(int argc, char *argv[])
+{
+  static th_info ti;
+
+  /* quiet down compiler about unused arguments */
+  if (1 < argc)
+      return (strlen(argv[1]) != 0);
+  th_info_init(&ti);    
+
+  printf("info: program ran as it should\n");
+  return (0);
+}
+EOF
+
+gcc -o test -Wall -Wextra example.c -ltheoradec
+
+./test

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-xiph/libtheora.git



More information about the pkg-xiph-commits mailing list