test/symbols-leak-test: make it work with macOS diff The <() stuff fails with an error: diff: extra operand `/dev/fd/61' Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/meson.build b/meson.build
index 43a5a98..6ed9fb8 100644
--- a/meson.build
+++ b/meson.build
@@ -276,6 +276,7 @@ test_env = environment()
test_env.set('XKB_LOG_LEVEL', 'debug')
test_env.set('XKB_LOG_VERBOSITY', '10')
test_env.set('top_srcdir', meson.source_root())
+test_env.set('top_builddir', meson.build_root())
test_env.set('MALLOC_PERTURB_', '15')
test_env.set('MallocPreScribble', '1')
test_env.set('MallocScribble', '1')
diff --git a/test/symbols-leak-test.bash b/test/symbols-leak-test.bash
index 0a74c5f..f739eed 100755
--- a/test/symbols-leak-test.bash
+++ b/test/symbols-leak-test.bash
@@ -1,16 +1,19 @@
#!/usr/bin/env bash
-set -e
+set -o pipefail -o errexit -o nounset
+
+tempdir=$(mktemp -d "$top_builddir"/symbols-leak-test.XXXXXXXXXX)
+trap 'rm -rf "$tempdir"' EXIT
# Check that all exported symbols are specified in the symbol version
# scripts. If this fails, please update the appropriate .map file
# (adding new version nodes as needed).
# xkbcommon symbols
-diff -a -u \
- <(grep -h '^\s\+xkb_' "$top_srcdir"/xkbcommon.map | sed -e 's/^\s\+\(.*\);/\1/' | sort) \
- <(grep -h 'XKB_EXPORT' -A1 "$top_srcdir"/src/{,xkbcomp,compose}/*.c | grep '^xkb_' | sed -e 's/(.*//' | sort)
+grep -h '^\s\+xkb_' "$top_srcdir"/xkbcommon.map | sed -e 's/^\s\+\(.*\);/\1/' | sort > "$tempdir"/symbols
+grep -h 'XKB_EXPORT' -A1 "$top_srcdir"/src/{,xkbcomp,compose}/*.c | grep '^xkb_' | sed -e 's/(.*//' | sort > "$tempdir"/exported
+diff -a -u "$tempdir"/symbols "$tempdir"/exported
# xkbcommon-x11 symbols
-diff -a -u \
- <(grep -h '^\s\+xkb_.*' "$top_srcdir"/xkbcommon-x11.map | sed -e 's/^\s\+\(.*\);/\1/' | sort) \
- <(grep -h 'XKB_EXPORT' -A1 "$top_srcdir"/src/x11/*.c | grep '^xkb_' | sed -e 's/(.*//' | sort)
+grep -h '^\s\+xkb_.*' "$top_srcdir"/xkbcommon-x11.map | sed -e 's/^\s\+\(.*\);/\1/' | sort > "$tempdir"/symbols
+grep -h 'XKB_EXPORT' -A1 "$top_srcdir"/src/x11/*.c | grep '^xkb_' | sed -e 's/(.*//' | sort > "$tempdir"/exported
+diff -a -u "$tempdir"/symbols "$tempdir"/exported