summaryrefslogtreecommitdiff
path: root/test/cases/libremakepkg.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/cases/libremakepkg.bats')
-rw-r--r--test/cases/libremakepkg.bats28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/cases/libremakepkg.bats b/test/cases/libremakepkg.bats
index 9ddfd2e..2184de2 100644
--- a/test/cases/libremakepkg.bats
+++ b/test/cases/libremakepkg.bats
@@ -241,3 +241,31 @@ teardown() {
popd
diff -u fixtures/libremakepkg/PKGBUILD-pkgver "$tmpdir/PKGBUILD"
}
+
+@test "libremakepkg can re-use source-packages" {
+ require network sudo || skip
+
+ cp fixtures/libremakepkg/PKGBUILD-hello "$tmpdir/PKGBUILD"
+ cd "$tmpdir"
+
+ # I'm tempted to use file checksums here, but that would break
+ # when we gain support for reproducible builds. So just use
+ # timestamps.
+
+ testsudo libremakepkg -l "$BATS_TEST_NAME"
+ globfile libretools-hello-1.0-1-any.src.tar.?z
+ globfile libretools-hello-1.0-1-any.pkg.tar.?z
+ a_stime=$(stat -c %Y -- libretools-hello-1.0-1-any.src.tar.?z)
+ a_ptime=$(stat -c %Y -- libretools-hello-1.0-1-any.pkg.tar.?z)
+
+ testsudo libremakepkg -l "$BATS_TEST_NAME" -S libretools-hello-1.0-1-any.src.tar.?z
+ globfile libretools-hello-1.0-1-any.src.tar.?z
+ globfile libretools-hello-1.0-1-any.pkg.tar.?z
+ b_stime=$(stat -c %Y -- libretools-hello-1.0-1-any.src.tar.?z)
+ b_ptime=$(stat -c %Y -- libretools-hello-1.0-1-any.pkg.tar.?z)
+
+ (( a_stime == b_stime ))
+ (( a_ptime < b_ptime ))
+ (( a_ptime > a_stime ))
+ (( b_ptime > a_stime ))
+}