From 9c33131ece34a52341b1a31606d56329371fcce8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 5 Jan 2015 20:28:36 -0500 Subject: librefetch: wasn't cleaning up temp files --- test/librefetch-test.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'test') 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 } -- cgit v1.2.2