All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Brandon Maier via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Brandon Maier <brandon.maier@collins.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH v3 2/4] package/bats-assert: new package
Date: Fri,  3 May 2024 01:59:58 +0000	[thread overview]
Message-ID: <20240503020000.3168109-2-brandon.maier@collins.com> (raw)
In-Reply-To: <20240503020000.3168109-1-brandon.maier@collins.com>

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

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
---
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

diff --git a/DEVELOPERS b/DEVELOPERS
index 7fc46d6b43..2dfd5afd34 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -540,6 +540,7 @@ F:	package/ncdu/
 N:	Brandon Maier <brandon.maier@collins.com>
 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/
diff --git a/package/Config.in b/package/Config.in
index f1da714418..673fc9a811 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/bats-assert/Config.in b/package/bats-assert/Config.in
new file mode 100644
index 0000000000..78fa0ac4d5
--- /dev/null
+++ b/package/bats-assert/Config.in
@@ -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
diff --git a/package/bats-assert/bats-assert.hash b/package/bats-assert/bats-assert.hash
new file mode 100644
index 0000000000..94c3908ab3
--- /dev/null
+++ b/package/bats-assert/bats-assert.hash
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256  98ca3b685f8b8993e48ec057565e6e2abcc541034ed5b0e81f191505682037fd  bats-assert-2.1.0.tar.gz
+
+# License files
+sha256  36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673  LICENSE
diff --git a/package/bats-assert/bats-assert.mk b/package/bats-assert/bats-assert.mk
new file mode 100644
index 0000000000..c0e37e0048
--- /dev/null
+++ b/package/bats-assert/bats-assert.mk
@@ -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))
-- 
2.44.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-05-03  2:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 21:08 [Buildroot] [PATCH 1/4] package/bats-core: bump to version 1.11.0 Brandon Maier via buildroot
2024-04-12 21:08 ` [Buildroot] [PATCH 2/4] package/bats-support: add bats support library Brandon Maier via buildroot
2024-04-12 21:08 ` [Buildroot] [PATCH 3/4] package/bats-assert: add bats-assert library Brandon Maier via buildroot
2024-04-12 21:08 ` [Buildroot] [PATCH 4/4] package/bats-file: add bats-file library Brandon Maier via buildroot
2024-04-25 19:58 ` [Buildroot] [PATCH v2 1/4] package/bats-core: bump to version 1.11.0 Brandon Maier via buildroot
2024-05-01 21:09   ` Thomas Petazzoni via buildroot
2024-05-03  1:59   ` [Buildroot] [PATCH v3 1/4] package/bats-support: new package Brandon Maier via buildroot
2024-05-03  1:59     ` Brandon Maier via buildroot [this message]
2024-05-03  1:59     ` [Buildroot] [PATCH v3 3/4] package/bats-file: " Brandon Maier via buildroot
2024-05-03  2:00     ` [Buildroot] [PATCH v3 4/4] support/testing: add bats runtime test Brandon Maier via buildroot
2024-05-05  9:21     ` [Buildroot] [PATCH v3 1/4] package/bats-support: new package Yann E. MORIN
2024-04-25 19:58 ` [Buildroot] [PATCH v2 2/4] package/bats-support: add bats support library Brandon Maier via buildroot
2024-05-01 21:13   ` Thomas Petazzoni via buildroot
2024-05-03  2:01     ` [Buildroot] [External] " Maier, Brandon L Collins via buildroot
2024-04-25 19:58 ` [Buildroot] [PATCH v2 3/4] package/bats-assert: add bats-assert library Brandon Maier via buildroot
2024-04-25 19:58 ` [Buildroot] [PATCH v2 4/4] package/bats-file: add bats-file library Brandon Maier via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240503020000.3168109-2-brandon.maier@collins.com \
    --to=buildroot@buildroot.org \
    --cc=brandon.maier@collins.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.