From a3d91b0a83339e19594dbc12b6345fb38b00f9ea Mon Sep 17 00:00:00 2001 From: Brandon Maier Date: Fri, 3 May 2024 01:59:59 +0000 Subject: [PATCH] package/bats-file: new package bats-file is a helper library providing common filesystem related assertions and helpers for Bats. This library does not provide an installer. Manually install the files under /usr/lib/bats/bats-file which is what the Arch Linux package does[1]. This makes the library loadable using `bats_load_library`[2]. [1] https://gitlab.archlinux.org/archlinux/packaging/packages/bats-file/-/blob/main/PKGBUILD?ref_type=heads [2] https://bats-core.readthedocs.io/en/stable/writing-tests.html#bats-load-library-load-system-wide-libraries Signed-off-by: Brandon Maier [yann.morin.1998@free.fr: move as sub-option of bats-core] Signed-off-by: Yann E. MORIN --- DEVELOPERS | 1 + package/bats-core/Config.in | 1 + package/bats-file/Config.in | 14 ++++++++++++++ package/bats-file/bats-file.hash | 5 +++++ package/bats-file/bats-file.mk | 18 ++++++++++++++++++ 5 files changed, 39 insertions(+) create mode 100644 package/bats-file/Config.in create mode 100644 package/bats-file/bats-file.hash create mode 100644 package/bats-file/bats-file.mk diff --git a/DEVELOPERS b/DEVELOPERS index 2dfd5afd34..c2d3f52a59 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -541,6 +541,7 @@ N: Brandon Maier F: board/freescale/ls1046a-frwy/ F: configs/ls1046a-frwy_defconfig F: package/bats-assert/ +F: package/bats-file/ F: package/bats-support/ F: package/python-pysensors/ F: package/qoriq-fm-ucode/ diff --git a/package/bats-core/Config.in b/package/bats-core/Config.in index d7c0a13b1f..00beb2115e 100644 --- a/package/bats-core/Config.in +++ b/package/bats-core/Config.in @@ -13,6 +13,7 @@ config BR2_PACKAGE_BATS_CORE if BR2_PACKAGE_BATS_CORE source "package/bats-assert/Config.in" +source "package/bats-file/Config.in" source "package/bats-support/Config.in" endif diff --git a/package/bats-file/Config.in b/package/bats-file/Config.in new file mode 100644 index 0000000000..c53fcf6643 --- /dev/null +++ b/package/bats-file/Config.in @@ -0,0 +1,14 @@ +config BR2_PACKAGE_BATS_FILE + bool "bats-file" + select BR2_PACKAGE_BATS_SUPPORT # runtime + help + bats-file is a helper library providing common filesystem + related assertions and helpers for Bats. + + Assertions are functions that perform a test and output + relevant information on failure to help debugging. They return + 1 on failure and 0 otherwise. Output, formatted for + readability, is sent to the standard error to make assertions + usable outside of @test blocks too. + + https://github.com/bats-core/bats-file diff --git a/package/bats-file/bats-file.hash b/package/bats-file/bats-file.hash new file mode 100644 index 0000000000..9530dc6d9d --- /dev/null +++ b/package/bats-file/bats-file.hash @@ -0,0 +1,5 @@ +# Locally calculated +sha256 9b69043241f3af1c2d251f89b4fcafa5df3f05e97b89db18d7c9bdf5731bb27a bats-file-0.4.0.tar.gz + +# License files +sha256 36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673 LICENSE diff --git a/package/bats-file/bats-file.mk b/package/bats-file/bats-file.mk new file mode 100644 index 0000000000..0499327fe0 --- /dev/null +++ b/package/bats-file/bats-file.mk @@ -0,0 +1,18 @@ +################################################################################ +# +# bats-file +# +################################################################################ + +BATS_FILE_VERSION = 0.4.0 +BATS_FILE_SITE = $(call github,bats-core,bats-file,v$(BATS_FILE_VERSION)) +BATS_FILE_LICENSE = CC0-1.0 +BATS_FILE_LICENSE_FILES = LICENSE + +define BATS_FILE_INSTALL_TARGET_CMDS + $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/bats/bats-file/src + $(INSTALL) -m 0755 $(@D)/*.bash -t $(TARGET_DIR)/usr/lib/bats/bats-file + $(INSTALL) -m 0755 $(@D)/src/*.bash -t $(TARGET_DIR)/usr/lib/bats/bats-file/src +endef + +$(eval $(generic-package))