[strip-nondeterminism] 01/03: debian/tests: move the autopkgtest command to a separate script

Mattia Rizzolo mattia at debian.org
Fri Jun 23 07:56:01 UTC 2017


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

mattia pushed a commit to branch debian
in repository strip-nondeterminism.

commit d4b2b87b09902d74028deaa6f18872f5a1204184
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Fri Jun 23 09:51:15 2017 +0200

    debian/tests: move the autopkgtest command to a separate script
    
    Long lines are very annoying, and they hide bugs.
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 debian/tests/control   |  2 +-
 debian/tests/testsuite | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/debian/tests/control b/debian/tests/control
index 66ed169..3d4379d 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,2 @@
-Test-Command: mkdir -p "${ADTTMP}" && cp -rv t/ bin/ "${ADTTMP}" && cd "${ADTTMP}" && for X in t/*.t; do perl -MExtUtils::Command::MM -MTest::Harness ${X} || return ${?}; done
+Test: testsuite
 Restrictions: allow-stderr
diff --git a/debian/tests/testsuite b/debian/tests/testsuite
new file mode 100755
index 0000000..ef16021
--- /dev/null
+++ b/debian/tests/testsuite
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -eu
+
+tmp="${AUTOPKGTEST_TMP:-"${ADTTMP:-"$(mktemp -d)"}"}"
+
+mkdir -p "$tmp"
+cp -rv t/ bin/ "$tmp"
+cd "$tmp"
+
+set +e
+ret=0
+for X in t/*.t; do
+    perl -MExtUtils::Command::MM -MTest::Harness "$X" || ret=$?
+done
+
+if [ "$ret" -eq 0 ]; then
+    echo "Tests succeeded"
+else
+    echo "Tests failed" >&2
+fi
+
+exit $ret

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/strip-nondeterminism.git



More information about the Reproducible-commits mailing list