[diffoscope] 01/03: make possible to run basic-command-line test without ADTTMP being set

Mattia Rizzolo mattia at debian.org
Wed Aug 31 16:28:12 CEST 2016


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

mattia pushed a commit to branch master
in repository diffoscope.

commit e7209f032d6ff165b62dcedb27cbb6b11aba3885
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Wed Aug 31 14:07:24 2016 +0000

    make possible to run basic-command-line test without ADTTMP being set
---
 debian/tests/basic-command-line | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/debian/tests/basic-command-line b/debian/tests/basic-command-line
index 6de3b2a..c88b11b 100755
--- a/debian/tests/basic-command-line
+++ b/debian/tests/basic-command-line
@@ -3,8 +3,8 @@
 # not set -e: we are testing exit codes
 
 if ! [ -d "$ADTTMP" ]; then
-	echo "ADTTMP not set." >&2
-	exit 1
+	ADTTMP=`mktemp -d`
+	TEMP=true
 fi
 
 echo "a" > $ADTTMP/a
@@ -22,3 +22,7 @@ if [ $? -ne 1 ]; then
 	echo "Exit code was different from 1 when comparing files with different content." >&2
 	exit 1
 fi
+
+if [ -n "${TEMP:-}" ]; then
+	rm -rf "$ADTTMP"
+fi

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


More information about the diffoscope mailing list