aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorknuxify <knuxify@gmail.com>2022-10-21 21:13:01 +0200
committerknuxify <knuxify@gmail.com>2022-10-21 21:46:25 +0200
commita6521a43935895613369118104eaa64293311eaf (patch)
tree7a7cb121d4e1f7c7006af34a2b3ed3be273bb219
parentf653196590d0fdbcdbfd1da9f5ee93796154101b (diff)
community/gitg: run tests
-rw-r--r--community/gitg/APKBUILD25
1 files changed, 22 insertions, 3 deletions
diff --git a/community/gitg/APKBUILD b/community/gitg/APKBUILD
index 05d5925edc3..6b9cc4a37ac 100644
--- a/community/gitg/APKBUILD
+++ b/community/gitg/APKBUILD
@@ -26,12 +26,30 @@ makedepends="
meson
vala
"
+checkdepends="bash xvfb-run"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://download.gnome.org/sources/gitg/${pkgver%.*}/gitg-$pkgver.tar.xz
meson-fix-build.patch
"
-# requires being in a git repo, and the aports one is too big (takes forever)
-options="!check"
+
+prepare() {
+ default_prepare
+
+ if want_check; then
+ # the test needs a git repository, so we make one here
+ # (we can't run this on aports since it's too large)
+ mkdir "$builddir"/tmprepo
+ cd "$builddir"/tmprepo
+ git init
+ # sometimes git fails to guess the email which would cause a failed
+ # build, this fixes it
+ git config --local user.name "test commiter"
+ git config --local user.email "test@example.com"
+ echo "test" > README.md
+ git add "README.md"
+ git commit -m "test commit"
+ fi
+}
build() {
abuild-meson . output
@@ -39,7 +57,8 @@ build() {
}
check() {
- meson test --no-rebuild --print-errorlogs -C output
+ cd "$builddir/tmprepo"
+ xvfb-run -a meson test --no-rebuild --print-errorlogs -C ../output
}
package() {