[Pkg-sdl-commits] [sdl-stretch] 01/04: Add tests for autopkgtest

Manuel A. Fernandez Montecelo mafm at moszumanska.debian.org
Tue Jun 27 21:54:28 UTC 2017


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

mafm pushed a commit to branch master
in repository sdl-stretch.

commit deb602d88b79ff38e65f660156d9c8afdbbe3d9a
Author: Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>
Date:   Tue Jun 27 23:12:33 2017 +0200

    Add tests for autopkgtest
---
 debian/changelog                            |  6 ++++++
 debian/control                              |  2 ++
 debian/tests/compile-libsdl-stretch-test0   | 30 +++++++++++++++++++++++++++++
 debian/tests/compile-libsdl-stretch-test0.c | 11 +++++++++++
 debian/tests/control                        |  3 +++
 5 files changed, 52 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index de8bdba..29e61bc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+sdl-stretch (0.3.1-6) UNRELEASED; urgency=medium
+
+  * Add tests for autopkgtest
+
+ -- Manuel A. Fernandez Montecelo <mafm at debian.org>  Tue, 27 Jun 2017 23:12:14 +0200
+
 sdl-stretch (0.3.1-5) unstable; urgency=medium
 
   * Bump Policy Standards-Version to 4.0.0 (no changes needed)
diff --git a/debian/control b/debian/control
index 2bc24d1..b2599eb 100644
--- a/debian/control
+++ b/debian/control
@@ -13,6 +13,8 @@ Build-Depends: debhelper (>= 10~),
 Vcs-Git: https://anonscm.debian.org/git/pkg-sdl/packages/sdl-stretch.git
 Vcs-Browser: https://anonscm.debian.org/git/pkg-sdl/packages/sdl-stretch.git
 Homepage: http://sdl-stretch.sourceforge.net
+Testsuite: autopkgtest
+
 
 Package: libsdl-stretch-0-3
 Architecture: any-amd64 any-i386
diff --git a/debian/tests/compile-libsdl-stretch-test0 b/debian/tests/compile-libsdl-stretch-test0
new file mode 100644
index 0000000..26daeae
--- /dev/null
+++ b/debian/tests/compile-libsdl-stretch-test0
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Author: Manuel A. Fernandez Montecelo <mafm at debian.org>
+#
+# autopkgtest check: Build example programs against the library, to perform a
+# basic smoke test
+
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+
+# compile
+cp -av $OLDPWD/compile-libsdl-stretch-test0.c .
+gcc -o compile-libsdl-stretch-test0-exec compile-libsdl-stretch-test0.c $(pkg-config --cflags --libs SDL_stretch sdl)
+echo "build: OK"
+
+# check/execute
+for executable in compile-libsdl-stretch-test0-exec
+do
+    [ -x $BINFILE ]
+    echo "check: executable does exist"
+
+    ./$BINFILE
+    echo "run: OK"
+done
+
+echo "run: all OK"
diff --git a/debian/tests/compile-libsdl-stretch-test0.c b/debian/tests/compile-libsdl-stretch-test0.c
new file mode 100644
index 0000000..8b9005d
--- /dev/null
+++ b/debian/tests/compile-libsdl-stretch-test0.c
@@ -0,0 +1,11 @@
+#include <SDL_stretch/SDL_stretch.h>
+
+#include <stdio.h>
+
+int main(int argc, char* argv[])
+{
+	const char* info = SDL_StretchInfo();
+	fprintf(stdout, "SDL_StretchInfo: %s\n", info);
+
+	return 0;
+}
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..9f74c95
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: compile-sdl-stretch-test0
+Depends: libsdl-stretch-dev, pkg-config, build-essential
+Restrictions: allow-stderr

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sdl/packages/sdl-stretch.git



More information about the pkg-sdl-commits mailing list