git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 11/12] t/Makefile: make "check-meson" work with Dash

From
Patrick Steinhardt <ps@pks.im>
Date
Dec 27, 2024, 13:59 UTC
Message-ID
<20241227-b4-pks-meson-docs-v2-11-f61e63edbfa1@pks.im>
In-Reply-To
<20241227-b4-pks-meson-docs-v2-0-f61e63edbfa1@pks.im>

The "check-meson" target uses process substitution to check whether extracted contents from "meson.build" match expected contents. Process substitution is unportable though and thus the target will fail when using for example Dash.

Fix this by writing data into a temporary directory.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 t/.gitignore |  1 +
 t/Makefile   | 12 +++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/t/.gitignore b/t/.gitignore
index 91cf5772fe5643dbe075da98ed5166e1899b9a54..3e6b0f2cc57ffed0394d1cd2efc1e374f1c2169b 100644
--- a/t/.gitignore
+++ b/t/.gitignore
@@ -2,4 +2,5 @@
 /test-results
 /.prove
 /chainlinttmp
+/mesontmp
 /out/
diff --git a/t/Makefile b/t/Makefile
index 290fb03ff011d39c31c5073c796aa6f4dc966283..daa5fcae86f3480079b8c9743dd28e3fd304c27b 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -103,6 +103,7 @@ clean-except-prove-cache: clean-chainlint
 
 clean: clean-except-prove-cache
 	$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
+	$(RM) -r mesontmp
 	$(RM) .prove
 
 clean-chainlint:
@@ -116,16 +117,17 @@ check-chainlint:
 
 check-meson:
 	@# awk acts up when trying to match single quotes, so we use \047 instead.
-	@printf "%s\n" \
+	@mkdir -p mesontmp && \
+	printf "%s\n" \
 		"integration_tests t[0-9][0-9][0-9][0-9]-*.sh" \
 		"unit_test_programs unit-tests/t-*.c" \
 		"clar_test_suites unit-tests/u-*.c" | \
 	while read -r variable pattern; do \
-		meson_tests=$$(awk "/^$$variable = \[\$$/ {flag=1 ; next } /^]$$/ { flag=0 } flag { gsub(/^  \047/, \"\"); gsub(/\047,\$$/, \"\"); print }" meson.build) && \
-		actual_tests=$$(ls $$pattern) && \
-		if test "$$meson_tests" != "$$actual_tests"; then \
+		awk "/^$$variable = \[\$$/ {flag=1 ; next } /^]$$/ { flag=0 } flag { gsub(/^  \047/, \"\"); gsub(/\047,\$$/, \"\"); print }" meson.build >mesontmp/meson.txt && \
+		ls $$pattern >mesontmp/actual.txt && \
+		if ! cmp mesontmp/meson.txt mesontmp/actual.txt; then \
 			echo "Meson tests differ from actual tests:"; \
-			diff -u <(echo "$$meson_tests") <(echo "$$actual_tests"); \
+			diff -u mesontmp/meson.txt mesontmp/actual.txt; \
 			exit 1; \
 		fi; \
 	done
-- 
2.48.0.rc0.311.gb6c66824c1.dirty
Previous: Patrick SteinhardtNext: Jonathan Nieder
Message 29 of 33 in “meson: wire up missing HTML documentation”
  1. 00/10 meson: wire up missing HTML documentationPatrick Steinhardt, Dec 13, 2024
  2. 01/10 meson: wire up support for AsciiDoctorPatrick Steinhardt, Dec 13, 2024
  3. 02/10 meson: properly wire up dependencies for our docsPatrick Steinhardt, Dec 13, 2024
  4. 03/10 meson: fix generation of merge toolsPatrick Steinhardt, Dec 13, 2024
  5. 04/10 meson: generate HTML pages for all man page categoriesPatrick Steinhardt, Dec 13, 2024
  6. Toon ClaesDec 23, 2024
  7. Patrick SteinhardtDec 27, 2024
  8. 06/10 meson: generate user manualPatrick Steinhardt, Dec 13, 2024
  9. 05/10 Documentation: inline user-manual.confPatrick Steinhardt, Dec 13, 2024
  10. 07/10 Documentation: refactor "api-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 13, 2024
  11. 09/10 meson: generate articlesPatrick Steinhardt, Dec 13, 2024
  12. 08/10 Documentation: refactor "howto-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 13, 2024
  13. 10/10 meson: install static files for HTML documentationPatrick Steinhardt, Dec 13, 2024
  14. Toon ClaesDec 23, 2024
  15. Patrick SteinhardtDec 27, 2024
  16. Toon ClaesJan 3, 2025
  17. Patrick SteinhardtJan 3, 2025
  18. 00/12 meson: wire up missing HTML documentationPatrick Steinhardt, Dec 27, 2024
  19. 01/12 meson: wire up support for AsciiDoctorPatrick Steinhardt, Dec 27, 2024
  20. 02/12 meson: properly wire up dependencies for our docsPatrick Steinhardt, Dec 27, 2024
  21. 03/12 meson: fix generation of merge toolsPatrick Steinhardt, Dec 27, 2024
  22. 04/12 meson: generate HTML pages for all man page categoriesPatrick Steinhardt, Dec 27, 2024
  23. 05/12 Documentation: inline user-manual.confPatrick Steinhardt, Dec 27, 2024
  24. 06/12 meson: generate user manualPatrick Steinhardt, Dec 27, 2024
  25. 07/12 Documentation: refactor "api-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 27, 2024
  26. 08/12 Documentation: refactor "howto-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 27, 2024
  27. 09/12 meson: generate articlesPatrick Steinhardt, Dec 27, 2024
  28. 10/12 meson: install static files for HTML documentationPatrick Steinhardt, Dec 27, 2024
  29. 11/12 t/Makefile: make "check-meson" work with DashPatrick Steinhardt, Dec 27, 2024
  30. Jonathan NiederJan 2, 2025
  31. Junio C HamanoJan 2, 2025
  32. Junio C HamanoJan 3, 2025
  33. 12/12 Documentation: wire up sanity checks for MesonPatrick Steinhardt, Dec 27, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.