[libfann] 112/133: Add autpkgtest for successful build & run against libfann

Christian Kastner chrisk-guest at moszumanska.debian.org
Sat Oct 4 21:07:54 UTC 2014


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

chrisk-guest pushed a commit to branch master
in repository libfann.

commit 9151642400032c0a48061faf07026bf1d81fd97a
Author: Christian Kastner <debian at kvr.at>
Date:   Sun Mar 2 23:53:09 2014 +0100

     Add autpkgtest for successful build & run against libfann
    
    Taken from Ubuntu. Thanks, Vibhav Pant
---
 debian/control       |  1 +
 debian/copyright     |  5 +++++
 debian/tests/build   | 35 +++++++++++++++++++++++++++++++++++
 debian/tests/control |  2 ++
 4 files changed, 43 insertions(+)

diff --git a/debian/control b/debian/control
index 1866492..da742cf 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Build-Depends-Indep:
     naturaldocs
 Standards-Version: 3.9.5
 X-Python-Version: >= 2.5
+XS-Testsuite: autopkgtest
 Homepage: http://leenissen.dk/fann/wp/
 Vcs-Git: git://scm.kvr.at/git/pkg-libfann.git
 Vcs-Browser: http://scm.kvr.at/git/?p=pkg-libfann.git;a=summary
diff --git a/debian/copyright b/debian/copyright
index 8f86597..62de035 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -20,6 +20,11 @@ Files: debian/patches/*
 Copyright:  2010-2011, Christian Kastner <debian at kvr.at>
 License: BSD-3-clause
 
+Files: debian/tests/*
+Copyright: 2012, Steffen Nissen <lukesky at diku.dk>
+           2013, Vibhav Pant <vibhavp at ubuntu.com>
+License: LGPL-2.1+
+
 License: LGPL-2.1+
  This package is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
diff --git a/debian/tests/build b/debian/tests/build
new file mode 100644
index 0000000..a012b29
--- /dev/null
+++ b/debian/tests/build
@@ -0,0 +1,35 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against libfann, to verify that the
+# headers are installed correctly
+# Source taken from http://leenissen.dk/fann/wp/help/getting-started/
+# (C) 2013 Vibhav Pant
+# Author: Vibhav Pant <vibhavp at ubuntu.com>
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+cat <<EOF > libfann_test.c
+#include <fann.h>
+
+int main(void)
+{
+    const unsigned int num_input = 2;
+    const unsigned int num_output = 1;
+    const unsigned int num_layers = 3;
+    const unsigned int num_neurons_hidden = 3;
+
+    struct fann *ann = fann_create_standard(num_layers, num_input,
+        num_neurons_hidden, num_output);
+    fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
+    fann_set_activation_function_output(ann, FANN_SIGMOID_SYMMETRIC);
+    fann_destroy(ann);
+    return 0;
+}
+EOF
+gcc -o libfann_test libfann_test.c -lfann -Wall -Werror
+echo "build: OK"
+[ -x libfann_test ]
+./libfann_test
+echo "run: OK"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..01faa51
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: build
+Depends: libfann-dev, build-essential
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libfann.git



More information about the debian-science-commits mailing list