[libfishsound] 01/01: Added simple autopkgtest script to verify compiling and linking work.

Petter Reinholdtsen pere at moszumanska.debian.org
Fri May 27 10:54:32 UTC 2016


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

pere pushed a commit to branch master
in repository libfishsound.

commit d8ad49525cdd09ee54a41f7ade5c05c0cf93f4e7
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Fri May 27 10:54:20 2016 +0000

    Added simple autopkgtest script to verify compiling and linking work.
---
 debian/tests/control                |  3 +++
 debian/tests/test-simple-build-link | 47 +++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..7612290
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: test-simple-build-link
+Depends: @, build-essential, valgrind
+Restrictions: allow-stderr
diff --git a/debian/tests/test-simple-build-link b/debian/tests/test-simple-build-link
new file mode 100644
index 0000000..30711ee
--- /dev/null
+++ b/debian/tests/test-simple-build-link
@@ -0,0 +1,47 @@
+#!/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
+
+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.  It should be
+# extended to really use the library to test a bit more of the
+# package.
+cat > example.c <<EOF
+#include <stdio.h>
+#include <fishsound/fishsound.h>
+int
+main (int argc, char ** argv)
+{
+  FishSound * fsound;
+
+  /* quiet down compiler about unused arguments */
+  if (1 < argc)
+      return (strlen(argv[1]) != 0);
+
+  fsound = fish_sound_new (FISH_SOUND_DECODE, NULL);
+  fish_sound_set_interleave (fsound, 1);
+  fish_sound_delete (fsound);
+
+  printf("info: program ran as it should\n");
+
+  exit (0);
+}
+EOF
+
+gcc -o test -Wall -Wextra example.c -lfishsound
+
+${VALGRIND} ./test

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



More information about the pkg-xiph-commits mailing list