feat(bats): upgrade bats to 1.10

Common library bats-assert, bats-file and bats-support are
now available as well
This commit is contained in:
Samuel Dolt 2023-08-16 11:11:26 +02:00 committed by Patrick Vogelaar
parent d1988fb97f
commit d43dcbde20
5 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# Library to share code needed to install most available bats library
# Bats library are shell scripts, so they are arch independant
inherit allarch
RDEPENDS:${PN} += "bats"
# Bats can find library in this folder by default
BATS_LIB_PATH ?= "${libdir}/bats"
# By default the library will have the same name as the recipe
BATS_INSTALL_DIR ?= "${BATS_LIB_PATH}/${PN}"
FILES:${PN} += "${BATS_INSTALL_DIR}"
do_install() {
install -d ${D}${BATS_INSTALL_DIR}
cp -r ${S}/src ${D}${BATS_INSTALL_DIR}/
install ${S}/load.bash ${D}${BATS_INSTALL_DIR}/
}

View File

@ -0,0 +1,15 @@
SUMMARY = "Common assertions for Bats"
DESCRIPTION = "bats-assert is a helper library providing common assertions for \
Bats."
HOMEPAGE = "https://github.com/bats-core/bats-assert"
LICENSE = "CC0-1.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7bae63a234e80ee7c6427dce9fdba6cc"
PV = "2.1.0"
SRC_URI = "git://github.com/bats-core/bats-assert.git;protocol=https;branch=master"
SRCREV = "78fa631d1370562d2cd4a1390989e706158e7bf0"
S = "${WORKDIR}/git"
inherit bats-library
RDEPENDS:${PN} += "bats-support"

View File

@ -0,0 +1,15 @@
SUMMARY = " Common filesystem assertions for Bats"
DESCRIPTION = "bats-file is a helper library providing common filesystem \
related assertions and helpers for Bats."
HOMEPAGE = "https://github.com/bats-core/bats-file"
LICENSE = "CC0-1.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7bae63a234e80ee7c6427dce9fdba6cc"
PV = "0.3.0+${SRCPV}"
SRC_URI = "git://github.com/bats-core/bats-file.git;protocol=https;branch=master"
SRCREV = "cb914cdc176da00e321d3bc92f88383698c701d6"
S = "${WORKDIR}/git"
inherit bats-library
RDEPENDS:${PN} += "bats-support"

View File

@ -0,0 +1,13 @@
SUMMARY = "Supporting library for Bats test helpers"
DESCRIPTION = "bats-support is a supporting library providing common \
functions to test helper libraries written for Bats."
HOMEPAGE = "https://github.com/bats-core/bats-support"
LICENSE = "CC0-1.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7bae63a234e80ee7c6427dce9fdba6cc"
PV = "0.3.0"
SRC_URI = "git://github.com/bats-core/bats-support.git;protocol=https;branch=master"
SRCREV = "3c8fadc5097c9acfc96d836dced2bb598e48b009"
S = "${WORKDIR}/git"
inherit bats-library

View File

@ -0,0 +1,35 @@
# backported from oe-core master
SUMMARY = "Bash Automated Testing System"
DESCRIPTION = "Bats is a TAP-compliant testing framework for Bash. It \
provides a simple way to verify that the UNIX programs you write behave as expected."
HOMEPAGE = "https://github.com/bats-core/bats-core"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=2970203aedf9e829edb96a137a4fe81b"
SRC_URI = "\
git://github.com/bats-core/bats-core.git;branch=master;protocol=https \
"
# v1.10.0
SRCREV = "f7defb94362f2053a3e73d13086a167448ea9133"
S = "${WORKDIR}/git"
# Numerous scripts assume ${baselib} == lib, which is not true.
#
do_configure:prepend() {
for f in ${S}/libexec/bats-core/* ${S}/lib/bats-core/* ; do
sed -i 's:\$BATS_ROOT/lib/:\$BATS_ROOT/${baselib}/:g' $f
done
}
do_install() {
# Just a bunch of bash scripts to install
${S}/install.sh ${D}${prefix} ${baselib}
}
RDEPENDS:${PN} = "bash"
FILES:${PN} += "${libdir}/bats-core/*"
PACKAGECONFIG ??= "pretty"
PACKAGECONFIG[pretty] = ",,,ncurses"