summaryrefslogtreecommitdiff
path: root/test/librefetch-test.sh
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-01-05 20:28:36 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-01-05 20:28:36 -0500
commit9c33131ece34a52341b1a31606d56329371fcce8 (patch)
treeeb9b94f19670f42ae8b661b4839234484c1f61bb /test/librefetch-test.sh
parent1b74c4c87cc1a268d3a9cae14335101dff25161f (diff)
librefetch: wasn't cleaning up temp filesv20150105.1
Diffstat (limited to 'test/librefetch-test.sh')
-rw-r--r--test/librefetch-test.sh24
1 files changed, 17 insertions, 7 deletions
diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh
index f8bb226..8dd957a 100644
--- a/test/librefetch-test.sh
+++ b/test/librefetch-test.sh
@@ -41,21 +41,31 @@ it_displays_help() {
empty $tmpdir/stderr
}
-# This test also does a rough test of file order in the PKGBUILD, as
-# well as making sure that it correctly keeps track of $BUILDDIR,
-# $startdir, and $SRCDEST.
-it_cleans_src_libre_first() {
+# This test used to be called "it_cleans_src_libre_first", but let's
+# be honest: it checks pretty much everything related to normal
+# operation.
+it_runs() {
+ local srcball=testpkg-1.0.tar.gz
cp librefetch.d/* "$tmpdir/"
cd "$tmpdir"
- # create garbage
+ # Create garbage, to verifiy that it cleans src-libre first
mkdir -p src-libre/foo
touch src-libre/foo/file
- # run librefetch
+ # Run librefetch
makepkg -g
- srcball=testpkg-1.0.tar.gz
+ # Verify that no temporary files were left around
+ not test -e librefetch.*
+
+ # Verify:
+ # - The srcball was created...
+ # - ... and is in the correct directory
+ # - The srcball does not contain the garbage created earlier
+ # - The files in the srcball are in the correct order (if the
+ # order isn't ensured, then this would only sometimes fail,
+ # unfortunately).
bsdtar tf "$tmpdir/srcdest/$srcball" > list-pkg.txt
diff -u list.txt list-pkg.txt
}