Просмотр исходного кода

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 <brandon.maier@collins.com>
[yann.morin.1998@free.fr: move as sub-option of bats-core]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Brandon Maier 1 год назад
Родитель
Сommit
a3d91b0a83

+ 1 - 0
DEVELOPERS

@@ -541,6 +541,7 @@ N:	Brandon Maier <brandon.maier@collins.com>
 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/

+ 1 - 0
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

+ 14 - 0
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

+ 5 - 0
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

+ 18 - 0
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))