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