From 8ab3d92ccf278389721b1ae8ff42dffef0e066ab Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 1 May 2017 17:14:16 -0400 Subject: bugfix [1/2]: librefetch: Add check for SRCBUILD-to-SRCBUILD operation --- test/librefetch-test.sh | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'test/librefetch-test.sh') 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 -- cgit v1.2.3-54-g00ecf