aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-04-09 21:34:21 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2023-04-09 21:35:40 +0200
commited2fa19e9d1c42b53c6520d076751d47b7e9c8d6 (patch)
treefa782a472a078f136924dbf16cfea0043d61c127 /Makefile
parent81c5046b3118323d756eaed6a521846cc1361fb5 (diff)
Check that all compatibility definitions link to a corresponding test
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a438c72..d72f763 100644
--- a/Makefile
+++ b/Makefile
@@ -25,10 +25,18 @@ clean:
$(RM) $(BYTEC) compat.info
check:
- @echo "Check: All definitions must be marked with tests"
+ @echo "Check: All definitions must link to a test"
@! (grep -P "^\\(compat-(def|guard)" *.el | grep -v "compat-tests:")
- @echo "Check: All definitions must use (compat-def* macros"
+ @echo "Check: All definitions must use compat-def* macros"
@! (grep -P "^\\(def" compat-[0-9][0-9].el)
+ @echo "Check: Test links must be valid"
+ @grep "(ert-deftest compat-" compat-tests.el | \
+ grep -E -v "\\(ert-deftest compat-(function|loaded-features) \\(\\)" | \
+ sed -E "s/\\(ert-deftest compat-| \\(\\).*//g" | sort > /tmp/compat-defs
+ @grep "compat-tests:" *.el | \
+ sed -E "s/.*<compat-tests:(.+?)>|.*\\[\\[compat-tests:(.+?)\\]\\]/\1\2/g" | \
+ sort | uniq > /tmp/compat-links
+ @ (diff /tmp/compat-defs /tmp/compat-defs)
$(BYTEC): compat-macs.el