summaryrefslogtreecommitdiff
path: root/test/librefetch-test.sh
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-05-01 17:14:16 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-05-01 17:24:16 -0400
commit8ab3d92ccf278389721b1ae8ff42dffef0e066ab (patch)
treebd7b07c405e6f43ef8a886f516b4616653d6644c /test/librefetch-test.sh
parentcd795c1446b705b2e14cf70655e859571d4f8755 (diff)
bugfix [1/2]: librefetch: Add check for SRCBUILD-to-SRCBUILD operation
Diffstat (limited to 'test/librefetch-test.sh')
-rw-r--r--test/librefetch-test.sh33
1 files changed, 32 insertions, 1 deletions
diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh
index 6871be1..b4be051 100644
--- a/test/librefetch-test.sh
+++ b/test/librefetch-test.sh
@@ -51,10 +51,41 @@ it_displays_help() {
# 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() {
+it_runs_with_mksource() {
local srcball=testpkg-1.0.tar.gz
cp librefetch.d/* "$tmpdir/"
cd "$tmpdir"
+ mv PKGBUILD{-mksource,}
+
+ # Create garbage, to verifiy that it cleans src-libre first
+ mkdir -p src-libre/foo
+ touch src-libre/foo/file
+
+ # Run librefetch
+ makepkg -g
+
+ # 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
+ # Verify that the signature was created and matches
+ gpg --quiet --verify "$tmpdir/srcdest/$srcball"{.sig,} 2>/dev/null
+}
+
+it_runs_with_srcbuild() {
+ local srcball=testpkg-1.0.tar.gz
+ cp librefetch.d/* "$tmpdir/"
+ cd "$tmpdir"
+ mv PKGBUILD{-srcbuild,}
+ mv SRCBUILD{-srcbuild,}
# Create garbage, to verifiy that it cleans src-libre first
mkdir -p src-libre/foo