summaryrefslogtreecommitdiff
path: root/test/librefetch-test.sh
diff options
context:
space:
mode:
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
}