diff --git a/layers/meta-belden-coreos/classes/bats-library.bbclass b/layers/meta-belden-coreos/classes/bats-library.bbclass new file mode 100644 index 0000000..280eb08 --- /dev/null +++ b/layers/meta-belden-coreos/classes/bats-library.bbclass @@ -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}/ +} diff --git a/layers/meta-belden-coreos/recipes-test/bats/bats-assert_2.1.0.bb b/layers/meta-belden-coreos/recipes-test/bats/bats-assert_2.1.0.bb new file mode 100644 index 0000000..92e4119 --- /dev/null +++ b/layers/meta-belden-coreos/recipes-test/bats/bats-assert_2.1.0.bb @@ -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" diff --git a/layers/meta-belden-coreos/recipes-test/bats/bats-file_git.bb b/layers/meta-belden-coreos/recipes-test/bats/bats-file_git.bb new file mode 100644 index 0000000..350b902 --- /dev/null +++ b/layers/meta-belden-coreos/recipes-test/bats/bats-file_git.bb @@ -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" diff --git a/layers/meta-belden-coreos/recipes-test/bats/bats-support_0.3.0.bb b/layers/meta-belden-coreos/recipes-test/bats/bats-support_0.3.0.bb new file mode 100644 index 0000000..cafbc0a --- /dev/null +++ b/layers/meta-belden-coreos/recipes-test/bats/bats-support_0.3.0.bb @@ -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 diff --git a/layers/meta-belden-coreos/recipes-test/bats/bats_1.10.0.bb b/layers/meta-belden-coreos/recipes-test/bats/bats_1.10.0.bb new file mode 100644 index 0000000..fdd8ca7 --- /dev/null +++ b/layers/meta-belden-coreos/recipes-test/bats/bats_1.10.0.bb @@ -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"