[devscripts] 03/05: Add a helper function to test_uscan

James McCoy jamessan at debian.org
Mon Jan 20 02:56:07 UTC 2014


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

jamessan pushed a commit to branch master
in repository devscripts.

commit 5d5f673df211703bda76f7cbb15d637ebe141a79
Author: James McCoy <jamessan at debian.org>
Date:   Sun Jan 19 19:25:46 2014 -0500

    Add a helper function to test_uscan
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 test/test_uscan | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/test/test_uscan b/test/test_uscan
index 2f27bef..ba08a58 100755
--- a/test/test_uscan
+++ b/test/test_uscan
@@ -31,6 +31,11 @@ cleanup(){
 
 trap cleanup 1 2 3 13 15
 
+containsName(){
+  expr "$1" : ".*/$2" > /dev/null
+  echo $?
+}
+
 . "${0%/*}/shunit2-helper-functions.sh"
 
 # The following function tests the Files-Excluded feature of uscan, which
@@ -86,10 +91,11 @@ END
 
     TARBALL=${PKG}_1+dfsg.orig.tar.gz
     assertTrue 'pristine tarball is not created' "[ -f $TMPDIR/$TARBALL ]"
-    assertNull 'file that must be excluded is present in the tarball'	\
-               "$( tar tzf $TMPDIR/$TARBALL  | grep exclude-this )"
-    assertNull "dir that must be excluded is present in the tarball"	\
-               "$(tar atf $TMPDIR/$TARBALL | grep exclude-dir)"
+    CONTENTS="$(tar atf $TMPDIR/$TARBALL)"
+    assertFalse 'file that must be excluded is present in the tarball'	\
+                $(containsName "$CONTENTS" exclude-this)
+    assertFalse "dir that must be excluded is present in the tarball"	\
+                $(containsName "$CONTENTS" exclude-dir)
     # 731849
     assertNull 'dirty root directory allowed command execution' "$OUTPUT"
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list