Skip to contentSkip to conversation

package/bats-core: bump to version 1.11.0

PATCH Superseded Brandon Maier via buildroot 2 participants 16 messages Apr 12, 2024 – May 5, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 package/bats-core: bump to version 1.11.0

https://github.com/bats-core/bats-core/releases/tag/v1.11.0
https://github.com/bats-core/bats-core/releases/tag/v1.10.0
https://github.com/bats-core/bats-core/releases/tag/v1.9.0

---
 package/bats-core/bats-core.hash | 2 +-
 package/bats-core/bats-core.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/bats-core/bats-core.hash +1 -1
index 81c0229af4..25b2b60339 100644
@@ -1,5 +1,5 @@
 # Locally calculated
-sha256  0f2df311a536e625a72bff64c838e67c7b5032e6ea9edcdf32758303062b2f3b  bats-core-1.8.2.tar.gz
+sha256  aeff09fdc8b0c88b3087c99de00cf549356d7a2f6a69e3fcec5e0e861d2f9063  bats-core-1.11.0.tar.gz
 
 # License files
 sha256  55074b2b3b87809105034e1468e59076554d76a80c67bcc592000cc3d929852d  LICENSE.md
package/bats-core/bats-core.mk +1 -1
index e172445930..716b167c00 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-BATS_CORE_VERSION = 1.8.2
+BATS_CORE_VERSION = 1.11.0
 BATS_CORE_SITE = $(call github,bats-core,bats-core,v$(BATS_CORE_VERSION))
 BATS_CORE_LICENSE = MIT
 BATS_CORE_LICENSE_FILES = LICENSE.md
Signature · 6 lines
2.29.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/4 package/bats-support: add bats support library

This library provides support functions needed by the bats-assert and bats-file libraries.

This library does not provide an installer. Manually install the files under /usr/lib/bats/bats-support 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-support/-/blob/main/PKGBUILD?ref_type=heads
[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html#bats-load-library-load-system-wide-libraries

---
 DEVELOPERS                             |  1 +
 package/Config.in                      |  1 +
 package/bats-support/Config.in         |  8 ++++++++
 package/bats-support/bats-support.hash |  5 +++++
 package/bats-support/bats-support.mk   | 17 +++++++++++++++++
 5 files changed, 32 insertions(+)
 create mode 100644 package/bats-support/Config.in
 create mode 100644 package/bats-support/bats-support.hash
 create mode 100644 package/bats-support/bats-support.mk
DEVELOPERS +1 -0
index 399b2931ff..846dc987a4 100644
@@ -540,6 +540,7 @@ F:	package/ncdu/
 N:	Brandon Maier <[email protected]>
 F:	board/freescale/ls1046a-frwy/
 F:	configs/ls1046a-frwy_defconfig
+F:	package/bats-support/
 F:	package/python-pysensors/
 F:	package/qoriq-fm-ucode/
 F:	package/unifdef/
package/Config.in +1 -0
index 1935077f0f..eef0ccc588 100644
@@ -170,6 +170,7 @@ endmenu
 menu "Development tools"
 	source "package/avocado/Config.in"
 	source "package/bats-core/Config.in"
+	source "package/bats-support/Config.in"
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
 	source "package/bsdiff/Config.in"
package/bats-support/Config.in new file +8 -0
new file mode 100644
index 0000000000..24b49cee1d
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_BATS_SUPPORT
+	bool "bats-support"
+	depends on BR2_PACKAGE_BATS_CORE # runtime
+	help
+	  bats-support is a supporting library providing common
+	  functions to test helper libraries written for Bats.
+
+	  https://github.com/bats-core/bats-support
package/bats-support/bats-support.hash new file +5 -0
new file mode 100644
index 0000000000..847f39e7c7
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  7815237aafeb42ddcc1b8c698fc5808026d33317d8701d5ec2396e9634e2918f  bats-support-0.3.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
package/bats-support/bats-support.mk new file +17 -0
new file mode 100644
index 0000000000..840aa52046
@@ -0,0 +1,17 @@
+################################################################################
+#
+# bats-support
+#
+################################################################################
+
+BATS_SUPPORT_VERSION = 0.3.0
+BATS_SUPPORT_SITE = $(call github,bats-core,bats-support,v$(BATS_SUPPORT_VERSION))
+BATS_SUPPORT_LICENSE = CC0-1.0
+BATS_SUPPORT_LICENSE_FILES = LICENSE
+
+define BATS_SUPPORT_INSTALL_TARGET_CMDS
+	install -Dm 0644 $(@D)/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-support"
+	install -Dm 0644 $(@D)/src/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-support/src"
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.29.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH 3/4 package/bats-assert: add bats-assert library

In reply to Brandon Maier via buildroot

bats-assert is a helper library providing common assertions for Bats.

This library does not provide an installer. Manually install the files under /usr/lib/bats/bats-assert 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-assert/-/blob/main/PKGBUILD?ref_type=heads
[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html#bats-load-library-load-system-wide-libraries

---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/bats-assert/Config.in        | 16 ++++++++++++++++
 package/bats-assert/bats-assert.hash |  5 +++++
 package/bats-assert/bats-assert.mk   | 17 +++++++++++++++++
 5 files changed, 40 insertions(+)
 create mode 100644 package/bats-assert/Config.in
 create mode 100644 package/bats-assert/bats-assert.hash
 create mode 100644 package/bats-assert/bats-assert.mk
DEVELOPERS +1 -0
index 846dc987a4..4bac9c9d1b 100644
@@ -540,6 +540,7 @@ F:	package/ncdu/
 N:	Brandon Maier <[email protected]>
 F:	board/freescale/ls1046a-frwy/
 F:	configs/ls1046a-frwy_defconfig
+F:	package/bats-assert/
 F:	package/bats-support/
 F:	package/python-pysensors/
 F:	package/qoriq-fm-ucode/
package/Config.in +1 -0
index eef0ccc588..9d54fd3817 100644
@@ -170,6 +170,7 @@ endmenu
 menu "Development tools"
 	source "package/avocado/Config.in"
 	source "package/bats-core/Config.in"
+	source "package/bats-assert/Config.in"
 	source "package/bats-support/Config.in"
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
package/bats-assert/Config.in new file +16 -0
new file mode 100644
index 0000000000..78fa0ac4d5
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_BATS_ASSERT
+	bool "bats-assert"
+	depends on BR2_PACKAGE_BATS_CORE # runtime
+	select BR2_PACKAGE_BATS_SUPPORT # runtime
+	help
+	  bats-assert is a helper library providing common assertions
+	  for Bats.
+
+	  In the context of this project, an assertion is a function
+	  that perform a test and returns 1 on failure or 0 on success.
+	  To make debugging easier, the assertion also outputs relevant
+	  information on failure. The output is formatted for
+	  readability. To make assertions usable outside of @test
+	  blocks, the output is sent to stderr.
+
+	  https://github.com/bats-core/bats-assert
package/bats-assert/bats-assert.hash new file +5 -0
new file mode 100644
index 0000000000..94c3908ab3
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  98ca3b685f8b8993e48ec057565e6e2abcc541034ed5b0e81f191505682037fd  bats-assert-2.1.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
package/bats-assert/bats-assert.mk new file +17 -0
new file mode 100644
index 0000000000..ec4858af7c
@@ -0,0 +1,17 @@
+################################################################################
+#
+# bats-assert
+#
+################################################################################
+
+BATS_ASSERT_VERSION = 2.1.0
+BATS_ASSERT_SITE = $(call github,bats-core,bats-assert,v$(BATS_ASSERT_VERSION))
+BATS_ASSERT_LICENSE = CC0-1.0
+BATS_ASSERT_LICENSE_FILES = LICENSE
+
+define BATS_ASSERT_INSTALL_TARGET_CMDS
+	install -Dm 0644 $(@D)/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-assert"
+	install -Dm 0644 $(@D)/src/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-assert/src"
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.29.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH 4/4 package/bats-file: add bats-file library

In reply to Brandon Maier via buildroot

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

---
 DEVELOPERS                       |  1 +
 package/Config.in                |  1 +
 package/bats-file/Config.in      | 15 +++++++++++++++
 package/bats-file/bats-file.hash |  5 +++++
 package/bats-file/bats-file.mk   | 17 +++++++++++++++++
 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
DEVELOPERS +1 -0
index 4bac9c9d1b..d2c45c905f 100644
@@ -541,6 +541,7 @@ N:	Brandon Maier <[email protected]>
 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/
package/Config.in +1 -0
index 9d54fd3817..e71421c2ff 100644
@@ -171,6 +171,7 @@ menu "Development tools"
 	source "package/avocado/Config.in"
 	source "package/bats-core/Config.in"
 	source "package/bats-assert/Config.in"
+	source "package/bats-file/Config.in"
 	source "package/bats-support/Config.in"
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
package/bats-file/Config.in new file +15 -0
new file mode 100644
index 0000000000..fa9312c9e4
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_BATS_FILE
+	bool "bats-file"
+	depends on BR2_PACKAGE_BATS_CORE # runtime
+	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
package/bats-file/bats-file.hash new file +5 -0
new file mode 100644
index 0000000000..9530dc6d9d
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  9b69043241f3af1c2d251f89b4fcafa5df3f05e97b89db18d7c9bdf5731bb27a  bats-file-0.4.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
package/bats-file/bats-file.mk new file +17 -0
new file mode 100644
index 0000000000..dda2d17475
@@ -0,0 +1,17 @@
+################################################################################
+#
+# 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 -Dm 0644 $(@D)/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-file"
+	install -Dm 0644 $(@D)/src/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-file/src"
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.29.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

PATCH v2 1/4 package/bats-core: bump to version 1.11.0

In reply to Brandon Maier via buildroot

https://github.com/bats-core/bats-core/releases/tag/v1.11.0
https://github.com/bats-core/bats-core/releases/tag/v1.10.0
https://github.com/bats-core/bats-core/releases/tag/v1.9.0

---
 package/bats-core/bats-core.hash | 2 +-
 package/bats-core/bats-core.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/bats-core/bats-core.hash +1 -1
index 81c0229af4..25b2b60339 100644
@@ -1,5 +1,5 @@
 # Locally calculated
-sha256  0f2df311a536e625a72bff64c838e67c7b5032e6ea9edcdf32758303062b2f3b  bats-core-1.8.2.tar.gz
+sha256  aeff09fdc8b0c88b3087c99de00cf549356d7a2f6a69e3fcec5e0e861d2f9063  bats-core-1.11.0.tar.gz
 
 # License files
 sha256  55074b2b3b87809105034e1468e59076554d76a80c67bcc592000cc3d929852d  LICENSE.md
package/bats-core/bats-core.mk +1 -1
index e172445930..716b167c00 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-BATS_CORE_VERSION = 1.8.2
+BATS_CORE_VERSION = 1.11.0
 BATS_CORE_SITE = $(call github,bats-core,bats-core,v$(BATS_CORE_VERSION))
 BATS_CORE_LICENSE = MIT
 BATS_CORE_LICENSE_FILES = LICENSE.md
Signature · 6 lines
2.44.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw
Quoted 9 lines · On Thu, 25 Apr 2024 19:58:13 +0000 Brandon Maier via buildroot…

https://github.com/bats-core/bats-core/releases/tag/v1.11.0
https://github.com/bats-core/bats-core/releases/tag/v1.10.0
https://github.com/bats-core/bats-core/releases/tag/v1.9.0

---
 package/bats-core/bats-core.hash | 2 +-
 package/bats-core/bats-core.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw

PATCH v3 1/4 package/bats-support: new package

In reply to Brandon Maier via buildroot

This library provides support functions needed by the bats-assert and bats-file libraries.

This library does not provide an installer. Manually install the files under /usr/lib/bats/bats-support 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-support/-/blob/main/PKGBUILD?ref_type=heads
[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html#bats-load-library-load-system-wide-libraries

---
v2:
- fix older versions of install that don't support -D with -t

v3:
- fix commit subject to be 'new package'
- switch 'install' to '$(INSTALL)'
- install with 0755 permissions
- remove unneeded quotes

---
 DEVELOPERS                             |  1 +
 package/Config.in                      |  1 +
 package/bats-support/Config.in         |  8 ++++++++
 package/bats-support/bats-support.hash |  5 +++++
 package/bats-support/bats-support.mk   | 18 ++++++++++++++++++
 5 files changed, 33 insertions(+)
 create mode 100644 package/bats-support/Config.in
 create mode 100644 package/bats-support/bats-support.hash
 create mode 100644 package/bats-support/bats-support.mk
DEVELOPERS +1 -0
index 5d198567d8..7fc46d6b43 100644
@@ -540,6 +540,7 @@ F:	package/ncdu/
 N:	Brandon Maier <[email protected]>
 F:	board/freescale/ls1046a-frwy/
 F:	configs/ls1046a-frwy_defconfig
+F:	package/bats-support/
 F:	package/python-pysensors/
 F:	package/qoriq-fm-ucode/
 F:	package/unifdef/
package/Config.in +1 -0
index 38e9c94198..f1da714418 100644
@@ -170,6 +170,7 @@ endmenu
 menu "Development tools"
 	source "package/avocado/Config.in"
 	source "package/bats-core/Config.in"
+	source "package/bats-support/Config.in"
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
 	source "package/bsdiff/Config.in"
package/bats-support/Config.in new file +8 -0
new file mode 100644
index 0000000000..24b49cee1d
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_BATS_SUPPORT
+	bool "bats-support"
+	depends on BR2_PACKAGE_BATS_CORE # runtime
+	help
+	  bats-support is a supporting library providing common
+	  functions to test helper libraries written for Bats.
+
+	  https://github.com/bats-core/bats-support
package/bats-support/bats-support.hash new file +5 -0
new file mode 100644
index 0000000000..847f39e7c7
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  7815237aafeb42ddcc1b8c698fc5808026d33317d8701d5ec2396e9634e2918f  bats-support-0.3.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
package/bats-support/bats-support.mk new file +18 -0
new file mode 100644
index 0000000000..765e08ffce
@@ -0,0 +1,18 @@
+################################################################################
+#
+# bats-support
+#
+################################################################################
+
+BATS_SUPPORT_VERSION = 0.3.0
+BATS_SUPPORT_SITE = $(call github,bats-core,bats-support,v$(BATS_SUPPORT_VERSION))
+BATS_SUPPORT_LICENSE = CC0-1.0
+BATS_SUPPORT_LICENSE_FILES = LICENSE
+
+define BATS_SUPPORT_INSTALL_TARGET_CMDS
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/bats/bats-support/src
+	$(INSTALL) -m 0755 $(@D)/*.bash -t $(TARGET_DIR)/usr/lib/bats/bats-support
+	$(INSTALL) -m 0755 $(@D)/src/*.bash -t $(TARGET_DIR)/usr/lib/bats/bats-support/src
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.44.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw

PATCH v3 2/4 package/bats-assert: new package

bats-assert is a helper library providing common assertions for Bats.

This library does not provide an installer. Manually install the files under /usr/lib/bats/bats-assert 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-assert/-/blob/main/PKGBUILD?ref_type=heads
[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html#bats-load-library-load-system-wide-libraries

---
v2:
- fix older versions of install that don't support -D with -t

v3:
- fix commit subject to be 'new package'
- switch 'install' to '$(INSTALL)'
- install with 0755 permissions
- remove unneeded quotes

---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/bats-assert/Config.in        | 16 ++++++++++++++++
 package/bats-assert/bats-assert.hash |  5 +++++
 package/bats-assert/bats-assert.mk   | 18 ++++++++++++++++++
 5 files changed, 41 insertions(+)
 create mode 100644 package/bats-assert/Config.in
 create mode 100644 package/bats-assert/bats-assert.hash
 create mode 100644 package/bats-assert/bats-assert.mk
DEVELOPERS +1 -0
index 7fc46d6b43..2dfd5afd34 100644
@@ -540,6 +540,7 @@ F:	package/ncdu/
 N:	Brandon Maier <[email protected]>
 F:	board/freescale/ls1046a-frwy/
 F:	configs/ls1046a-frwy_defconfig
+F:	package/bats-assert/
 F:	package/bats-support/
 F:	package/python-pysensors/
 F:	package/qoriq-fm-ucode/
package/Config.in +1 -0
index f1da714418..673fc9a811 100644
@@ -169,6 +169,7 @@ endmenu
 
 menu "Development tools"
 	source "package/avocado/Config.in"
+	source "package/bats-assert/Config.in"
 	source "package/bats-core/Config.in"
 	source "package/bats-support/Config.in"
 	source "package/binutils/Config.in"
package/bats-assert/Config.in new file +16 -0
new file mode 100644
index 0000000000..78fa0ac4d5
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_BATS_ASSERT
+	bool "bats-assert"
+	depends on BR2_PACKAGE_BATS_CORE # runtime
+	select BR2_PACKAGE_BATS_SUPPORT # runtime
+	help
+	  bats-assert is a helper library providing common assertions
+	  for Bats.
+
+	  In the context of this project, an assertion is a function
+	  that perform a test and returns 1 on failure or 0 on success.
+	  To make debugging easier, the assertion also outputs relevant
+	  information on failure. The output is formatted for
+	  readability. To make assertions usable outside of @test
+	  blocks, the output is sent to stderr.
+
+	  https://github.com/bats-core/bats-assert
package/bats-assert/bats-assert.hash new file +5 -0
new file mode 100644
index 0000000000..94c3908ab3
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  98ca3b685f8b8993e48ec057565e6e2abcc541034ed5b0e81f191505682037fd  bats-assert-2.1.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
package/bats-assert/bats-assert.mk new file +18 -0
new file mode 100644
index 0000000000..c0e37e0048
@@ -0,0 +1,18 @@
+################################################################################
+#
+# bats-assert
+#
+################################################################################
+
+BATS_ASSERT_VERSION = 2.1.0
+BATS_ASSERT_SITE = $(call github,bats-core,bats-assert,v$(BATS_ASSERT_VERSION))
+BATS_ASSERT_LICENSE = CC0-1.0
+BATS_ASSERT_LICENSE_FILES = LICENSE
+
+define BATS_ASSERT_INSTALL_TARGET_CMDS
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/bats/bats-assert/src
+	$(INSTALL) -m 0755 $(@D)/*.bash -t $(TARGET_DIR)/usr/lib/bats/bats-assert
+	$(INSTALL) -m 0755 $(@D)/src/*.bash -t $(TARGET_DIR)/usr/lib/bats/bats-assert/src
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.44.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw

PATCH v3 3/4 package/bats-file: new package

In reply to Brandon Maier via buildroot

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

---
v2:
- fix older versions of install that don't support -D with -t

v3:
- fix commit subject to be 'new package'
- switch 'install' to '$(INSTALL)'
- install with 0755 permissions
- remove unneeded quotes

---
 DEVELOPERS                       |  1 +
 package/Config.in                |  1 +
 package/bats-file/Config.in      | 15 +++++++++++++++
 package/bats-file/bats-file.hash |  5 +++++
 package/bats-file/bats-file.mk   | 18 ++++++++++++++++++
 5 files changed, 40 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
DEVELOPERS +1 -0
index 2dfd5afd34..c2d3f52a59 100644
@@ -541,6 +541,7 @@ N:	Brandon Maier <[email protected]>
 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/
package/Config.in +1 -0
index 673fc9a811..eac9b74ba4 100644
@@ -171,6 +171,7 @@ menu "Development tools"
 	source "package/avocado/Config.in"
 	source "package/bats-assert/Config.in"
 	source "package/bats-core/Config.in"
+	source "package/bats-file/Config.in"
 	source "package/bats-support/Config.in"
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
package/bats-file/Config.in new file +15 -0
new file mode 100644
index 0000000000..fa9312c9e4
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_BATS_FILE
+	bool "bats-file"
+	depends on BR2_PACKAGE_BATS_CORE # runtime
+	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
package/bats-file/bats-file.hash new file +5 -0
new file mode 100644
index 0000000000..9530dc6d9d
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  9b69043241f3af1c2d251f89b4fcafa5df3f05e97b89db18d7c9bdf5731bb27a  bats-file-0.4.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
package/bats-file/bats-file.mk new file +18 -0
new file mode 100644
index 0000000000..0499327fe0
@@ -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))
Signature · 6 lines
2.44.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw

PATCH v3 4/4 support/testing: add bats runtime test

In reply to Brandon Maier via buildroot

Tests the bats-core, bats-support, bats-assert, and bats-file packages.

---
 support/testing/tests/package/test_bats.py    | 33 +++++++++++++++++++
 .../rootfs-overlay/root/test-bats-assert.bats | 11 +++++++
 .../rootfs-overlay/root/test-bats-core.bats   | 11 +++++++
 .../rootfs-overlay/root/test-bats-file.bats   | 10 ++++++
 4 files changed, 65 insertions(+)
 create mode 100644 support/testing/tests/package/test_bats.py
 create mode 100755 support/testing/tests/package/test_bats/rootfs-overlay/root/test-bats-assert.bats
 create mode 100755 support/testing/tests/package/test_bats/rootfs-overlay/root/test-bats-core.bats
 create mode 100755 support/testing/tests/package/test_bats/rootfs-overlay/root/test-bats-file.bats
support/testing/tests/package/test_bats.py new file +33 -0
new file mode 100644
index 0000000000..c75a6df294
@@ -0,0 +1,33 @@
+import os
+
+import infra.basetest
+
+
+class TestBats(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_ENABLE_LOCALE_WHITELIST=""
+        BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+        BR2_PACKAGE_BASH=y
+        BR2_PACKAGE_BATS_CORE=y
+        BR2_PACKAGE_BATS_ASSERT=y
+        BR2_PACKAGE_BATS_FILE=y
+        BR2_ROOTFS_OVERLAY="{}"
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """.format(
+           # overlay to add a gnuradio python test script
+           infra.filepath("tests/package/test_bats/rootfs-overlay"))
+
+    def test_run(self):
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv5",
+                           kernel="builtin",
+                           options=["-initrd", cpio_file])
+        self.emulator.login()
+
+        self.assertRunOk("bats --version")
+
+        self.assertRunOk("bats /root/test-bats-core.bats", timeout=5)
+        self.assertRunOk("bats /root/test-bats-assert.bats", timeout=5)
+        self.assertRunOk("bats /root/test-bats-file.bats", timeout=5)
support/testing/tests/package/test_bats/rootfs-overlay/root/test-bats-assert.bats new file +11 -0
new file mode 100755
index 0000000000..cd0cb48290
@@ -0,0 +1,11 @@
+#!/usr/bin/env bats
+
+setup() {
+    bats_load_library bats-support
+    bats_load_library bats-assert
+}
+
+@test "bats-assert assert_output" {
+    run echo "Hello World"
+    assert_output "Hello World"
+}
support/testing/tests/package/test_bats/rootfs-overlay/root/test-bats-core.bats new file +11 -0
new file mode 100755
index 0000000000..54ec941e03
@@ -0,0 +1,11 @@
+#!/usr/bin/env bats
+
+@test "bats-core true" {
+    true
+}
+
+@test "bats-core run" {
+    run echo "Hello World"
+    [ "$status" -eq 0 ]
+    [ "$output" = "Hello World" ]
+}
support/testing/tests/package/test_bats/rootfs-overlay/root/test-bats-file.bats new file +10 -0
new file mode 100755
index 0000000000..0ac2616b99
@@ -0,0 +1,10 @@
+#!/usr/bin/env bats
+
+setup() {
+    bats_load_library bats-support
+    bats_load_library bats-file
+}
+
+@test "bats-file assert_exists" {
+    assert_exists /root/test-bats-file.bats
+}
Signature · 6 lines
2.44.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#10 lore raw

Re: [Buildroot] [PATCH v3 1/4] package/bats-support: new package

In reply to Brandon Maier via buildroot

Brandon, All,

On 2024-05-03 01:59 +0000, Brandon Maier via buildroot spake thusly:

Quoted 7 lines

This library provides support functions needed by the bats-assert and bats-file libraries.

This library does not provide an installer. Manually install the files under /usr/lib/bats/bats-support which is what the Arch Linux package does[1]. This makes the library loadable using bats_load_library[2].

Quoted 5 lines

[1] https://gitlab.archlinux.org/archlinux/packaging/packages/bats-support/-/blob/main/PKGBUILD?ref_type=heads
[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html#bats-load-library-load-system-wide-libraries

---

[--SNIP--]

package/Config.in endmenu · line 173

Quoted 9 lines
package/Config.in +1 -0
index 38e9c94198..f1da714418 100644
@@ -170,6 +170,7 @@ endmenu
 menu "Development tools"
 	source "package/avocado/Config.in"
 	source "package/bats-core/Config.in"
+	source "package/bats-support/Config.in"

While this looks like the thing to do, including the bats sub-packages from here is sub-optimal. Indeed, when all the series is applied, the menuconfig will look something like:

[ ] bats-assert (NEW)
[*] bats
[ ] bats-file (NEW)
[ ] bats-support (NEW)

This is not very nice-looking.

Instead, I've moved the 'source' statements to the bats-core package itself (elided for brevity; check the actual package for exact code):

config BR2_PACKAGE_BATS_CORE
bool "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

Now the menuconfig looks nicer:

[*] bats
[ ] bats-assert (NEW)
[ ] bats-file (NEW)
[ ] bats-support (NEW)

As a consequence of the includes now being guarded by the if-endif conditional block, the dependency on bats-core is no longer needed on each package, so I also dropped it.

Series applied to master with this little cleanup, thanks!

Regards,
Yann E. MORIN.

Quoted 59 lines
package/Config.in +0 -0
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
 	source "package/bsdiff/Config.in"
package/bats-support/Config.in new file +8 -0
new file mode 100644
index 0000000000..24b49cee1d
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_BATS_SUPPORT
+	bool "bats-support"
+	depends on BR2_PACKAGE_BATS_CORE # runtime
+	help
+	  bats-support is a supporting library providing common
+	  functions to test helper libraries written for Bats.
+
+	  https://github.com/bats-core/bats-support
package/bats-support/bats-support.hash new file +5 -0
new file mode 100644
index 0000000000..847f39e7c7
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  7815237aafeb42ddcc1b8c698fc5808026d33317d8701d5ec2396e9634e2918f  bats-support-0.3.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
package/bats-support/bats-support.mk new file +18 -0
new file mode 100644
index 0000000000..765e08ffce
@@ -0,0 +1,18 @@
+################################################################################
+#
+# bats-support
+#
+################################################################################
+
+BATS_SUPPORT_VERSION = 0.3.0
+BATS_SUPPORT_SITE = $(call github,bats-core,bats-support,v$(BATS_SUPPORT_VERSION))
+BATS_SUPPORT_LICENSE = CC0-1.0
+BATS_SUPPORT_LICENSE_FILES = LICENSE
+
+define BATS_SUPPORT_INSTALL_TARGET_CMDS
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/bats/bats-support/src
+	$(INSTALL) -m 0755 $(@D)/*.bash -t $(TARGET_DIR)/usr/lib/bats/bats-support
+	$(INSTALL) -m 0755 $(@D)/src/*.bash -t $(TARGET_DIR)/usr/lib/bats/bats-support/src
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.44.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#11 lore raw

PATCH v2 2/4 package/bats-support: add bats support library

In reply to Brandon Maier via buildroot

This library provides support functions needed by the bats-assert and bats-file libraries.

This library does not provide an installer. Manually install the files under /usr/lib/bats/bats-support 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-support/-/blob/main/PKGBUILD?ref_type=heads
[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html#bats-load-library-load-system-wide-libraries

---
Changes v1 -> v2:
- fix older versions of install that don't support -D

---
 DEVELOPERS                             |  1 +
 package/Config.in                      |  1 +
 package/bats-support/Config.in         |  8 ++++++++
 package/bats-support/bats-support.hash |  5 +++++
 package/bats-support/bats-support.mk   | 18 ++++++++++++++++++
 5 files changed, 33 insertions(+)
 create mode 100644 package/bats-support/Config.in
 create mode 100644 package/bats-support/bats-support.hash
 create mode 100644 package/bats-support/bats-support.mk
DEVELOPERS +1 -0
index 399b2931ff..846dc987a4 100644
@@ -540,6 +540,7 @@ F:	package/ncdu/
 N:	Brandon Maier <[email protected]>
 F:	board/freescale/ls1046a-frwy/
 F:	configs/ls1046a-frwy_defconfig
+F:	package/bats-support/
 F:	package/python-pysensors/
 F:	package/qoriq-fm-ucode/
 F:	package/unifdef/
package/Config.in +1 -0
index 1935077f0f..eef0ccc588 100644
@@ -170,6 +170,7 @@ endmenu
 menu "Development tools"
 	source "package/avocado/Config.in"
 	source "package/bats-core/Config.in"
+	source "package/bats-support/Config.in"
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
 	source "package/bsdiff/Config.in"
package/bats-support/Config.in new file +8 -0
new file mode 100644
index 0000000000..24b49cee1d
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_BATS_SUPPORT
+	bool "bats-support"
+	depends on BR2_PACKAGE_BATS_CORE # runtime
+	help
+	  bats-support is a supporting library providing common
+	  functions to test helper libraries written for Bats.
+
+	  https://github.com/bats-core/bats-support
package/bats-support/bats-support.hash new file +5 -0
new file mode 100644
index 0000000000..847f39e7c7
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  7815237aafeb42ddcc1b8c698fc5808026d33317d8701d5ec2396e9634e2918f  bats-support-0.3.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
package/bats-support/bats-support.mk new file +18 -0
new file mode 100644
index 0000000000..37c69c7d62
@@ -0,0 +1,18 @@
+################################################################################
+#
+# bats-support
+#
+################################################################################
+
+BATS_SUPPORT_VERSION = 0.3.0
+BATS_SUPPORT_SITE = $(call github,bats-core,bats-support,v$(BATS_SUPPORT_VERSION))
+BATS_SUPPORT_LICENSE = CC0-1.0
+BATS_SUPPORT_LICENSE_FILES = LICENSE
+
+define BATS_SUPPORT_INSTALL_TARGET_CMDS
+	install -d -m 0755 $(TARGET_DIR)/usr/lib/bats/bats-support/src
+	install -m 0644 $(@D)/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-support"
+	install -m 0644 $(@D)/src/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-support/src"
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.44.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#12 lore raw

Re: [Buildroot] [PATCH v2 2/4] package/bats-support: add bats support library

Hello Brandon,

Thanks for the patch!

Commit title should be:

package/bats-support: new package

More comments below.

Quoted 7 lines · On Thu, 25 Apr 2024 19:58:14 +0000 Brandon Maier via buildroot…

This library provides support functions needed by the bats-assert and bats-file libraries.

This library does not provide an installer. Manually install the files under /usr/lib/bats/bats-support which is what the Arch Linux package does[1]. This makes the library loadable using bats_load_library[2].

Quoted 7 lines

[1] https://gitlab.archlinux.org/archlinux/packaging/packages/bats-support/-/blob/main/PKGBUILD?ref_type=heads
[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html#bats-load-library-load-system-wide-libraries

---
Changes v1 -> v2:
- fix older versions of install that don't support -D

Hu? We use the -D option of install everywhere in Buildroot. How can your build work if you have a version of install that doesn't support -D ?

package/bats-support/bats-support.mk line 15

Quoted 4 lines
package/bats-support/bats-support.mk new file +4 -0
+define BATS_SUPPORT_INSTALL_TARGET_CMDS
+	install -d -m 0755 $(TARGET_DIR)/usr/lib/bats/bats-support/src
+	install -m 0644 $(@D)/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-support"
+	install -m 0644 $(@D)/src/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-support/src"

Use $(INSTALL) instead of install.

You can skip the double quotes around the file paths. We don't double quotes the paths in any other Buildroot .mk file.

Also, -m 0644 is not consistent with how the files from bats-core are installed:

$ ls -l output/target/usr/lib/bats-core/
total 68
-rwxr-xr-x. 1 thomas thomas  7988  1 mai   23:03 common.bash
-rwxr-xr-x. 1 thomas thomas  6058  1 mai   23:03 formatter.bash
-rwxr-xr-x. 1 thomas thomas   838  1 mai   23:03 preprocessing.bash
-rwxr-xr-x. 1 thomas thomas  3722  1 mai   23:03 semaphore.bash
-rwxr-xr-x. 1 thomas thomas 16483  1 mai   23:03 test_functions.bash
-rwxr-xr-x. 1 thomas thomas 14979  1 mai   23:03 tracing.bash
-rwxr-xr-x. 1 thomas thomas  1019  1 mai   23:03 validator.bash
-rwxr-xr-x. 1 thomas thomas  1900  1 mai   23:03 warnings.bash

They are installed 0755. Should we try to be consistent with this? Or it doesn't make sense for a specific reason?

Also, while not mandatory at all, it would be nice to have small runtime tests for these bats-* packages. Nothing fancy, just something stupid/simple that exercises a bit those packages.

These comments apply in a completely identical way to the other 2 patches in this series.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#13 lore raw

Re: [Buildroot] [External] Re: [PATCH v2 2/4] package/bats-support: add bats support library

Hi Thomas,

Quoted 7 lines

-----Original Message-----
From: Thomas Petazzoni <[email protected]>
Sent: Wednesday, May 1, 2024 4:14 PM
To: Brandon Maier via buildroot <[email protected]>
Cc: Maier, Brandon L Collins <[email protected]>
Subject: [External] Re: [Buildroot] [PATCH v2 2/4] package/bats-support: add bats support library

Quoted 6 lines
Quoted 2 lines

Changes v1 -> v2:
- fix older versions of install that don't support -D

Hu? We use the -D option of install everywhere in Buildroot. How can your build work if you have a version of install that doesn't support -D ?

Sorry I didn't look at this close enough. It's an issue that older versions of install didn't support using both -D and -t <dir> at the same time.

Quoted 26 lines

package/bats-support/bats-support.mk

Quoted 3 lines
package/bats-support/bats-support.mk new file +3 -0
+define BATS_SUPPORT_INSTALL_TARGET_CMDS
+   install -d -m 0755 $(TARGET_DIR)/usr/lib/bats/bats-support/src
+   install -m 0644 $(@D)/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-

support"

Quoted 1 line

+ install -m 0644 $(@D)/src/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-

support/src"

Use $(INSTALL) instead of install.

You can skip the double quotes around the file paths. We don't double quotes the paths in any other Buildroot .mk file.

Also, -m 0644 is not consistent with how the files from bats-core are installed:

$ ls -l output/target/usr/lib/bats-core/
total 68
(quoted diff) +0 -8
-rwxr-xr-x. 1 thomas thomas  7988  1 mai   23:03 common.bash
-rwxr-xr-x. 1 thomas thomas  6058  1 mai   23:03 formatter.bash
-rwxr-xr-x. 1 thomas thomas   838  1 mai   23:03 preprocessing.bash
-rwxr-xr-x. 1 thomas thomas  3722  1 mai   23:03 semaphore.bash
-rwxr-xr-x. 1 thomas thomas 16483  1 mai   23:03 test_functions.bash
-rwxr-xr-x. 1 thomas thomas 14979  1 mai   23:03 tracing.bash
-rwxr-xr-x. 1 thomas thomas  1019  1 mai   23:03 validator.bash
-rwxr-xr-x. 1 thomas thomas  1900  1 mai   23:03 warnings.bash
Quoted 2 lines

They are installed 0755. Should we try to be consistent with this? Or it doesn't make sense for a specific reason?

I will change to make it consistent. Both 0755 or 0644 would work as the files must be sourced, which only needs read permission.

Quoted 11 lines

Also, while not mandatory at all, it would be nice to have small runtime tests for these bats-* packages. Nothing fancy, just something stupid/simple that exercises a bit those packages.

These comments apply in a completely identical way to the other 2 patches in this series.

Thanks!

Thomas

Thanks for the review! I agree with the other comments as well. I sent a v3 with changes.

Brandon
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#14 lore raw

PATCH v2 3/4 package/bats-assert: add bats-assert library

In reply to Brandon Maier via buildroot

bats-assert is a helper library providing common assertions for Bats.

This library does not provide an installer. Manually install the files under /usr/lib/bats/bats-assert 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-assert/-/blob/main/PKGBUILD?ref_type=heads
[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html#bats-load-library-load-system-wide-libraries

---
Changes v1 -> v2:
- fix older versions of install that don't support -D
- reorder package/Config.in to comply with check-package

---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/bats-assert/Config.in        | 16 ++++++++++++++++
 package/bats-assert/bats-assert.hash |  5 +++++
 package/bats-assert/bats-assert.mk   | 18 ++++++++++++++++++
 5 files changed, 41 insertions(+)
 create mode 100644 package/bats-assert/Config.in
 create mode 100644 package/bats-assert/bats-assert.hash
 create mode 100644 package/bats-assert/bats-assert.mk
DEVELOPERS +1 -0
index 846dc987a4..4bac9c9d1b 100644
@@ -540,6 +540,7 @@ F:	package/ncdu/
 N:	Brandon Maier <[email protected]>
 F:	board/freescale/ls1046a-frwy/
 F:	configs/ls1046a-frwy_defconfig
+F:	package/bats-assert/
 F:	package/bats-support/
 F:	package/python-pysensors/
 F:	package/qoriq-fm-ucode/
package/Config.in +1 -0
index eef0ccc588..98ff90a005 100644
@@ -169,6 +169,7 @@ endmenu
 
 menu "Development tools"
 	source "package/avocado/Config.in"
+	source "package/bats-assert/Config.in"
 	source "package/bats-core/Config.in"
 	source "package/bats-support/Config.in"
 	source "package/binutils/Config.in"
package/bats-assert/Config.in new file +16 -0
new file mode 100644
index 0000000000..78fa0ac4d5
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_BATS_ASSERT
+	bool "bats-assert"
+	depends on BR2_PACKAGE_BATS_CORE # runtime
+	select BR2_PACKAGE_BATS_SUPPORT # runtime
+	help
+	  bats-assert is a helper library providing common assertions
+	  for Bats.
+
+	  In the context of this project, an assertion is a function
+	  that perform a test and returns 1 on failure or 0 on success.
+	  To make debugging easier, the assertion also outputs relevant
+	  information on failure. The output is formatted for
+	  readability. To make assertions usable outside of @test
+	  blocks, the output is sent to stderr.
+
+	  https://github.com/bats-core/bats-assert
package/bats-assert/bats-assert.hash new file +5 -0
new file mode 100644
index 0000000000..94c3908ab3
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  98ca3b685f8b8993e48ec057565e6e2abcc541034ed5b0e81f191505682037fd  bats-assert-2.1.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
package/bats-assert/bats-assert.mk new file +18 -0
new file mode 100644
index 0000000000..2413b1f699
@@ -0,0 +1,18 @@
+################################################################################
+#
+# bats-assert
+#
+################################################################################
+
+BATS_ASSERT_VERSION = 2.1.0
+BATS_ASSERT_SITE = $(call github,bats-core,bats-assert,v$(BATS_ASSERT_VERSION))
+BATS_ASSERT_LICENSE = CC0-1.0
+BATS_ASSERT_LICENSE_FILES = LICENSE
+
+define BATS_ASSERT_INSTALL_TARGET_CMDS
+	install -d -m 0755 $(TARGET_DIR)/usr/lib/bats/bats-assert/src
+	install -m 0644 $(@D)/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-assert"
+	install -m 0644 $(@D)/src/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-assert/src"
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.44.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#15 lore raw

PATCH v2 4/4 package/bats-file: add bats-file library

In reply to Brandon Maier via buildroot

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

---
Changes v1 -> v2:
- fix older versions of install that don't support -D

---
 DEVELOPERS                       |  1 +
 package/Config.in                |  1 +
 package/bats-file/Config.in      | 15 +++++++++++++++
 package/bats-file/bats-file.hash |  5 +++++
 package/bats-file/bats-file.mk   | 18 ++++++++++++++++++
 5 files changed, 40 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
DEVELOPERS +1 -0
index 4bac9c9d1b..d2c45c905f 100644
@@ -541,6 +541,7 @@ N:	Brandon Maier <[email protected]>
 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/
package/Config.in +1 -0
index 98ff90a005..4af0e52b58 100644
@@ -171,6 +171,7 @@ menu "Development tools"
 	source "package/avocado/Config.in"
 	source "package/bats-assert/Config.in"
 	source "package/bats-core/Config.in"
+	source "package/bats-file/Config.in"
 	source "package/bats-support/Config.in"
 	source "package/binutils/Config.in"
 	source "package/bitwise/Config.in"
package/bats-file/Config.in new file +15 -0
new file mode 100644
index 0000000000..fa9312c9e4
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_BATS_FILE
+	bool "bats-file"
+	depends on BR2_PACKAGE_BATS_CORE # runtime
+	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
package/bats-file/bats-file.hash new file +5 -0
new file mode 100644
index 0000000000..9530dc6d9d
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  9b69043241f3af1c2d251f89b4fcafa5df3f05e97b89db18d7c9bdf5731bb27a  bats-file-0.4.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
package/bats-file/bats-file.mk new file +18 -0
new file mode 100644
index 0000000000..66c2a7b9f3
@@ -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 0644 $(@D)/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-file"
+	install -m 0644 $(@D)/src/*.bash -t "$(TARGET_DIR)/usr/lib/bats/bats-file/src"
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.44.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot