[Dev] [dbscripts] [PATCH 26/31] Reduce test dependencies

Luke Shumaker lukeshu at lukeshu.com
Fri Apr 6 18:43:59 GMT 2018


From: Pierre Schmitz <pierre at archlinux.de>

(cherry picked from commit c39624b25a16ed260b420d5689f0a73378fa1372)
---
 test/cases/packages.bats                | 45 ---------------------------------
 test/fixtures/pkg-any-a/PKGBUILD        |  1 +
 test/fixtures/pkg-any-b/PKGBUILD        |  1 +
 test/fixtures/pkg-simple-a/PKGBUILD     |  1 +
 test/fixtures/pkg-simple-b/PKGBUILD     |  1 +
 test/fixtures/pkg-simple-epoch/PKGBUILD |  1 +
 test/fixtures/pkg-single-arch/PKGBUILD  |  1 +
 test/fixtures/pkg-single-epoch/PKGBUILD |  1 +
 test/fixtures/pkg-split-a/PKGBUILD      |  1 +
 test/fixtures/pkg-split-b/PKGBUILD      |  1 +
 10 files changed, 9 insertions(+), 45 deletions(-)
 delete mode 100755 test/cases/packages.bats

diff --git a/test/cases/packages.bats b/test/cases/packages.bats
deleted file mode 100755
index 657de91..0000000
--- a/test/cases/packages.bats
+++ /dev/null
@@ -1,45 +0,0 @@
-load ../lib/common
-
- at test "packages" {
-	local result
-	local pkg
-	local pkgbase
-	local pkgarchs
-	local pkgarch
-	local tmp
-	tmp=$(mktemp -d)
-
-	# FIXME: Evaluate if this test is sane and even needed
-
-	cp -rL fixtures/* "${tmp}"
-
-	for pkgbase in "${tmp}"/*; do
-		pushd "${pkgbase}"
-		run namcap -e pkgnameindesc,tags PKGBUILD
-		[ -z "$output" ]
-
-		__buildPackage
-
-		# FIXME: Is overriding IFS a bats bug?
-		IFS=' '
-		pkgarchs=($(. PKGBUILD; echo ${arch[@]}))
-		for pkgarch in "${pkgarchs[@]}"; do
-			echo "Building ${pkgbase} on ${pkgarch}"
-			if [[ $pkgarch != "$ARCH_HOST" && $pkgarch != any ]]; then
-				# Cross-arch namcap is silly:
-				#
-				#   W: Referenced library 'libc.so.6' is an uninstalled dependency
-				#   W: Dependency included and not needed ('glibc')»
-				continue
-			fi
-			for pkg in *-${pkgarch}${PKGEXT}; do
-				msg 'run namcap -e pkgnameindesc %q' "${pkg}"
-				run namcap -e pkgnameindesc "${pkg}"
-				printf '%s\n' "$output" | sed 's/^/> /'
-				cp "$pkg" -t /tmp -f
-				[ -z "$output" ]
-			done
-		done
-		popd
-	done
-}
diff --git a/test/fixtures/pkg-any-a/PKGBUILD b/test/fixtures/pkg-any-a/PKGBUILD
index cd5d66f..bf8f39c 100644
--- a/test/fixtures/pkg-any-a/PKGBUILD
+++ b/test/fixtures/pkg-any-a/PKGBUILD
@@ -5,6 +5,7 @@ pkgdesc="A package called ${pkgname}"
 arch=('any')
 url='http://www.archlinux.org/'
 license=('GPL')
+options=(!strip)
 
 package() {
 	install -d -m755 "${pkgdir}"/usr/share/${pkgname}
diff --git a/test/fixtures/pkg-any-b/PKGBUILD b/test/fixtures/pkg-any-b/PKGBUILD
index 90794fc..295cc77 100644
--- a/test/fixtures/pkg-any-b/PKGBUILD
+++ b/test/fixtures/pkg-any-b/PKGBUILD
@@ -5,6 +5,7 @@ pkgdesc="A package called ${pkgname}"
 arch=('any')
 url='http://www.archlinux.org/'
 license=('GPL')
+options=(!strip)
 
 package() {
 	install -d -m755 "${pkgdir}"/usr/share/${pkgname}
diff --git a/test/fixtures/pkg-simple-a/PKGBUILD b/test/fixtures/pkg-simple-a/PKGBUILD
index 9b4478e..d3fcbbb 100644
--- a/test/fixtures/pkg-simple-a/PKGBUILD
+++ b/test/fixtures/pkg-simple-a/PKGBUILD
@@ -6,6 +6,7 @@ arch=('i686' 'x86_64')
 url='http://www.archlinux.org/'
 license=('GPL')
 depends=('glibc')
+options=(!strip)
 makedepends=('gcc')
 source=('Makefile' 'test.c')
 md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
diff --git a/test/fixtures/pkg-simple-b/PKGBUILD b/test/fixtures/pkg-simple-b/PKGBUILD
index 4a9e58d..fb44762 100644
--- a/test/fixtures/pkg-simple-b/PKGBUILD
+++ b/test/fixtures/pkg-simple-b/PKGBUILD
@@ -6,6 +6,7 @@ arch=('i686' 'x86_64')
 url='http://www.archlinux.org/'
 license=('GPL')
 depends=('glibc')
+options=(!strip)
 makedepends=('gcc')
 source=('Makefile' 'test.c')
 md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
diff --git a/test/fixtures/pkg-simple-epoch/PKGBUILD b/test/fixtures/pkg-simple-epoch/PKGBUILD
index 0761b32..ef1261f 100644
--- a/test/fixtures/pkg-simple-epoch/PKGBUILD
+++ b/test/fixtures/pkg-simple-epoch/PKGBUILD
@@ -7,6 +7,7 @@ arch=('i686' 'x86_64')
 url='http://www.archlinux.org/'
 license=('GPL')
 depends=('glibc')
+options=(!strip)
 makedepends=('gcc')
 source=('Makefile' 'test.c')
 md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
diff --git a/test/fixtures/pkg-single-arch/PKGBUILD b/test/fixtures/pkg-single-arch/PKGBUILD
index 581efb4..de5dbc2 100644
--- a/test/fixtures/pkg-single-arch/PKGBUILD
+++ b/test/fixtures/pkg-single-arch/PKGBUILD
@@ -6,6 +6,7 @@ arch=('x86_64')
 url='http://www.archlinux.org/'
 license=('GPL')
 depends=('glibc')
+options=(!strip)
 
 package() {
 	install -D -m755 /bin/true ${pkgdir}/usr/bin/${pkgname}
diff --git a/test/fixtures/pkg-single-epoch/PKGBUILD b/test/fixtures/pkg-single-epoch/PKGBUILD
index c1bc3d6..95898ac 100644
--- a/test/fixtures/pkg-single-epoch/PKGBUILD
+++ b/test/fixtures/pkg-single-epoch/PKGBUILD
@@ -7,6 +7,7 @@ arch=('x86_64')
 url='http://www.archlinux.org/'
 license=('GPL')
 depends=('glibc')
+options=(!strip)
 
 package() {
 	install -D -m755 /bin/true ${pkgdir}/usr/bin/${pkgname}
diff --git a/test/fixtures/pkg-split-a/PKGBUILD b/test/fixtures/pkg-split-a/PKGBUILD
index f7a0576..06b6148 100644
--- a/test/fixtures/pkg-split-a/PKGBUILD
+++ b/test/fixtures/pkg-split-a/PKGBUILD
@@ -7,6 +7,7 @@ arch=('i686' 'x86_64')
 url='http://www.archlinux.org/'
 license=('GPL')
 depends=('glibc')
+options=(!strip)
 makedepends=('gcc')
 source=('Makefile' 'test.c')
 md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
diff --git a/test/fixtures/pkg-split-b/PKGBUILD b/test/fixtures/pkg-split-b/PKGBUILD
index 3bd635c..7d1f0d6 100644
--- a/test/fixtures/pkg-split-b/PKGBUILD
+++ b/test/fixtures/pkg-split-b/PKGBUILD
@@ -8,6 +8,7 @@ url='http://www.archlinux.org/'
 license=('GPL')
 
 depends=('glibc')
+options=(!strip)
 makedepends=('gcc')
 source=('Makefile' 'test.c')
 md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
-- 
2.16.2




More information about the Dev mailing list