Git fork

t/Makefile: make "check-meson" work with Dash

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
d8af27d3 7a3136e5

+8 -5
+1
t/.gitignore
··· 2 2 /test-results 3 3 /.prove 4 4 /chainlinttmp 5 + /mesontmp 5 6 /out/
+7 -5
t/Makefile
··· 103 103 104 104 clean: clean-except-prove-cache 105 105 $(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)' 106 + $(RM) -r mesontmp 106 107 $(RM) .prove 107 108 108 109 clean-chainlint: ··· 116 117 117 118 check-meson: 118 119 @# awk acts up when trying to match single quotes, so we use \047 instead. 119 - @printf "%s\n" \ 120 + @mkdir -p mesontmp && \ 121 + printf "%s\n" \ 120 122 "integration_tests t[0-9][0-9][0-9][0-9]-*.sh" \ 121 123 "unit_test_programs unit-tests/t-*.c" \ 122 124 "clar_test_suites unit-tests/u-*.c" | \ 123 125 while read -r variable pattern; do \ 124 - meson_tests=$$(awk "/^$$variable = \[\$$/ {flag=1 ; next } /^]$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047,\$$/, \"\"); print }" meson.build) && \ 125 - actual_tests=$$(ls $$pattern) && \ 126 - if test "$$meson_tests" != "$$actual_tests"; then \ 126 + awk "/^$$variable = \[\$$/ {flag=1 ; next } /^]$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047,\$$/, \"\"); print }" meson.build >mesontmp/meson.txt && \ 127 + ls $$pattern >mesontmp/actual.txt && \ 128 + if ! cmp mesontmp/meson.txt mesontmp/actual.txt; then \ 127 129 echo "Meson tests differ from actual tests:"; \ 128 - diff -u <(echo "$$meson_tests") <(echo "$$actual_tests"); \ 130 + diff -u mesontmp/meson.txt mesontmp/actual.txt; \ 129 131 exit 1; \ 130 132 fi; \ 131 133 done