aboutsummaryrefslogtreecommitdiff
path: root/test/check-spacing-style.sh
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2022-04-16 15:13:08 -0500
committerGitHub <noreply@github.com>2022-04-16 15:13:08 -0500
commitfdfa6dbb0e69742029d53f0e163b8e7e7e6860f5 (patch)
tree6a300ef3e1b25e22224b042cc8a8c07b43709950 /test/check-spacing-style.sh
parent0b3f8750e7d307987eef9e63e327488a81c29a71 (diff)
rewrite tests (#515)
* rewrite tests to work with meson This ports our tests to meson and makes them able to be run in parallel. * add tests to ci * rewrite test/check-trailing-newlines in bash This test was using a GNU sed command which does not work on Alpine Linux.
Diffstat (limited to 'test/check-spacing-style.sh')
-rw-r--r--test/check-spacing-style.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/check-spacing-style.sh b/test/check-spacing-style.sh
new file mode 100644
index 00000000..b8c1cd2a
--- /dev/null
+++ b/test/check-spacing-style.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+top_srcdir=${SOURCE_ROOT:-..}
+. ${top_srcdir}/test/setup_env.sh
+
+ebegin "Checking spacing style"
+out=$(cd ${top_srcdir}; find src -name '*.[ch]' \
+ ! -name queue.h \
+ -exec grep -n -E \
+ -e '\<(for|if|switch|while)\(' \
+ -e '\<(for|if|switch|while) \( ' \
+ -e ' ;' \
+ -e '[[:space:]]$' \
+ -e '\){' \
+ -e '(^|[^:])//' \
+ {} +)
+[ -z "${out}" ]
+eend $? "These lines violate style rules:"$'\n'"${out}"