add basic tests using bats
This commit is contained in:
parent
a8f564287e
commit
43fb2c012e
|
@ -19,3 +19,5 @@ checkapk
|
||||||
devbuild
|
devbuild
|
||||||
functions.sh
|
functions.sh
|
||||||
newapkbuild
|
newapkbuild
|
||||||
|
src
|
||||||
|
pkg
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -93,6 +93,9 @@ help:
|
||||||
@echo "$(P) makefile"
|
@echo "$(P) makefile"
|
||||||
@echo "usage: make install [ DESTDIR=<path> ]"
|
@echo "usage: make install [ DESTDIR=<path> ]"
|
||||||
|
|
||||||
|
check: $(USR_BIN_FILE) functions.sh
|
||||||
|
cd tests && bats *.bats
|
||||||
|
|
||||||
install: $(USR_BIN_FILES) $(SAMPLES) abuild.conf functions.sh
|
install: $(USR_BIN_FILES) $(SAMPLES) abuild.conf functions.sh
|
||||||
install -d $(DESTDIR)/$(bindir) $(DESTDIR)/$(sysconfdir) \
|
install -d $(DESTDIR)/$(bindir) $(DESTDIR)/$(sysconfdir) \
|
||||||
$(DESTDIR)/$(datadir) $(DESTDIR)/$(mandir)/man1 \
|
$(DESTDIR)/$(datadir) $(DESTDIR)/$(mandir)/man1 \
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
setup() {
|
||||||
|
export ABUILD=../abuild
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "help text" {
|
||||||
|
$ABUILD -h
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "version string" {
|
||||||
|
$ABUILD -V
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
||||||
|
|
||||||
|
# test package
|
||||||
|
pkgname="pkg1"
|
||||||
|
pkgver="1.0"
|
||||||
|
pkgrel=0
|
||||||
|
pkgdesc="Dummy test package"
|
||||||
|
url="https://gitlab.alpinelinux.org/alpine/aports"
|
||||||
|
arch="noarch"
|
||||||
|
license="MIT"
|
||||||
|
subpackages="$pkgname-dev $pkgname-doc"
|
||||||
|
source=""
|
||||||
|
builddir="$srcdir/pkg1-1.0"
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
mkdir -p "$builddir"
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
mkdir -p usr/include usr/bin usr/share/man/man1
|
||||||
|
touch usr/include/$pkgname.h
|
||||||
|
touch usr/bin/$pkgname
|
||||||
|
touch usr/share/man/man1/$pkgname.1
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
mkdir -p "$pkgdir"
|
||||||
|
cp -r * "$pkgdir"/
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue