[libtheora] 01/01: Extend autopkgtest scripts a bit, and test example binaries too.

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


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

pere pushed a commit to branch master
in repository libtheora.

commit 25c6ac010b3b3242df8cd3e5687cf6eb724afa4d
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Tue May 24 13:59:10 2016 +0000

    Extend autopkgtest scripts a bit, and test example binaries too.
---
 debian/tests/control                |  4 ++--
 debian/tests/test-binaries          | 29 +++++++++++++++++++++++++++
 debian/tests/test-build-examples    | 40 -------------------------------------
 debian/tests/test-simple-build-link | 10 ++++++++--
 4 files changed, 39 insertions(+), 44 deletions(-)

diff --git a/debian/tests/control b/debian/tests/control
index 7af7240..bfb36fa 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,2 @@
-Tests: test-simple-build-link
-Depends: @
+Tests: test-simple-build-link, test-binaries
+Depends: @, debconf
diff --git a/debian/tests/test-binaries b/debian/tests/test-binaries
new file mode 100755
index 0000000..a8a6968
--- /dev/null
+++ b/debian/tests/test-binaries
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# Depend on debconf to get a simple png file
+
+set -e
+set -x
+
+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
+
+if type valgrind >/dev/null 2>&1 ; then
+    VALGRIND=valgrind
+fi
+
+$VALGRIND theora_png2theora -o test.ogv /usr/share/pixmaps/debian-logo.png
+
+$VALGRIND theora_dump_video test.ogv > test-video.dump
+
+# FIXME figure out how to test these too:
+# theora_encoder_example
+# theora_player_example
diff --git a/debian/tests/test-build-examples b/debian/tests/test-build-examples
deleted file mode 100644
index 9140555..0000000
--- a/debian/tests/test-build-examples
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/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
index 3a5a25d..05bf60f 100755
--- a/debian/tests/test-simple-build-link
+++ b/debian/tests/test-simple-build-link
@@ -12,8 +12,14 @@ set -x
 
 cd $WORKDIR
 
+if type valgrind >/dev/null 2>&1 ; then
+    VALGRIND=valgrind
+fi
+
 # This is just a simple code example to compile to verify the headers
-# exist, are includable and the library is linkable.
+# 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>
@@ -35,4 +41,4 @@ EOF
 
 gcc -o test -Wall -Wextra example.c -ltheoradec
 
-./test
+${VALGRIND} ./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