[liblinear] 03/06: Define an autopkgtest that runs the examples from the documentation

Christian Kastner chrisk-guest at moszumanska.debian.org
Tue Aug 26 18:30:04 UTC 2014


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

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

commit eb2ef5a656d969a50f30d495173a1ef80f6a5630
Author: Christian Kastner <debian at kvr.at>
Date:   Tue Aug 26 10:34:21 2014 -0700

    Define an autopkgtest that runs the examples from the documentation
---
 debian/tests/control     |  2 ++
 debian/tests/executables | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..a438411
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: executables
+Depends: liblinear-tools
diff --git a/debian/tests/executables b/debian/tests/executables
new file mode 100644
index 0000000..93c2104
--- /dev/null
+++ b/debian/tests/executables
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Run the examples from the man pages. Assumes $ADTTMP is set, see
+# /usr/share/doc/autopkgtest/README.package-tests.gz
+set -e
+
+# Copy the example data to $ADTTMP, and run the examples.
+cp heart_scale "$ADTTMP"
+cd "$ADTTMP"
+
+liblinear-train heart_scale
+liblinear-train -v 5 -e 0.001 heart_scale
+# Both of these produce about reaching max iterations; we ignore it. Also, the
+# classes don't fit heart_scale, but that's not the point here.
+# We don't want to use autopkgtest's Restriction: allow-stderr generally, so
+# redirect stderr here
+liblinear-train -c 10 -w1 2 -w2 5 -w3 2 heart_scale 2>&1
+liblinear-train -c 10 -w3 1 -w2 5 heart_scale 2>&1
+
+liblinear-train -s 0 heart_scale
+liblinear-predict -b 1 heart_scale heart_scale.model output_file

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



More information about the debian-science-commits mailing list