Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/openblas: add a new option to install tests
@ 2023-05-08 18:10 Julien Olivain
  2023-05-08 18:10 ` [Buildroot] [PATCH 2/2] support/testing/tests/package/test_openblas.py: new runtime test Julien Olivain
  2023-05-08 20:56 ` [Buildroot] [PATCH 1/2] package/openblas: add a new option to install tests Yann E. MORIN
  0 siblings, 2 replies; 3+ messages in thread
From: Julien Olivain @ 2023-05-08 18:10 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain

This option can be used for runtime testing or package debugging.

Signed-off-by: Julien Olivain <ju.o@free.fr>
---
 package/openblas/Config.in   |  5 +++++
 package/openblas/openblas.mk | 18 ++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/package/openblas/Config.in b/package/openblas/Config.in
index 0144e93a3f..58976e657a 100644
--- a/package/openblas/Config.in
+++ b/package/openblas/Config.in
@@ -94,4 +94,9 @@ config BR2_PACKAGE_OPENBLAS_USE_LOCKING
 	  function calls from multiple threads, then locking is
 	  mandatory for correct operation.
 
+config BR2_PACKAGE_OPENBLAS_INSTALL_TESTS
+	bool "install tests"
+	help
+	  Install C test programs on target.
+
 endif
diff --git a/package/openblas/openblas.mk b/package/openblas/openblas.mk
index f7a50d7bc7..3fa0bbfce7 100644
--- a/package/openblas/openblas.mk
+++ b/package/openblas/openblas.mk
@@ -77,4 +77,22 @@ define OPENBLAS_INSTALL_TARGET_CMDS
 		-C $(@D) install PREFIX=$(TARGET_DIR)/usr
 endef
 
+ifeq ($(BR2_PACKAGE_OPENBLAS_INSTALL_TESTS),y)
+# The actual test list depends on the architecture and/or some build
+# options. This macro installs all the test programs and input data
+# found in the ctest build directory.
+define OPENBLAS_INSTALL_TESTS
+	mkdir -p $(TARGET_DIR)/usr/libexec/openblas/tests
+	find $(@D)/ctest \
+		-type f -name "x[sdcz]cblat[123]" -perm -0100 \
+		-exec $(INSTALL) -m 0755 {} \
+			$(TARGET_DIR)/usr/libexec/openblas/tests \;
+	find $(@D)/ctest \
+		-type f -name "[sdcz]in[123]" \
+		-exec $(INSTALL) -m 0644 {} \
+			$(TARGET_DIR)/usr/libexec/openblas/tests \;
+endef
+OPENBLAS_POST_INSTALL_TARGET_HOOKS += OPENBLAS_INSTALL_TESTS
+endif
+
 $(eval $(generic-package))
-- 
2.40.1

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-08 20:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-08 18:10 [Buildroot] [PATCH 1/2] package/openblas: add a new option to install tests Julien Olivain
2023-05-08 18:10 ` [Buildroot] [PATCH 2/2] support/testing/tests/package/test_openblas.py: new runtime test Julien Olivain
2023-05-08 20:56 ` [Buildroot] [PATCH 1/2] package/openblas: add a new option to install tests Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox