diff options
author | EuAndreh <eu@euandre.org> | 2025-04-05 16:21:17 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-04-05 16:21:17 -0300 |
commit | 0f5b1950c77455a44b5204d1550ca5360073f72d (patch) | |
tree | 51d0ab7ca0a7c28b3b21964947e5442fb01c32d9 | |
parent | src/content/: Fix sorting of articles published in the same day (diff) | |
download | euandre.org-0f5b1950c77455a44b5204d1550ca5360073f72d.tar.gz euandre.org-0f5b1950c77455a44b5204d1550ca5360073f72d.tar.xz |
Makefile: Add test for checking unsorted articles
Diffstat (limited to '')
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 18 |
2 files changed, 19 insertions, 1 deletions
@@ -19,6 +19,8 @@ feed.xml /src/all-contents.txt /src/all-snippets-list.txt /src/install.txt +/src/sort-expected.txt +/src/sort-given.txt /sources.txt /install.txt /email.txt @@ -164,6 +164,8 @@ derived-assets = \ src/all-contents.txt \ src/all-snippets-list.txt \ src/install.txt \ + src/sort-expected.txt \ + src/sort-given.txt \ src/sources.txt \ install.txt \ sources.txt \ @@ -273,6 +275,20 @@ sources.txt install.txt: +src/sort-expected.txt: + dirname $(articles.adoc) | env LANG=POSIX.UTF-8 sort | uniq -c | \ + awk '{ printf "%s\t%s\n", $$2, $$1 }'> $@ + +src/sort-given.txt: $(sources.conf) src/sort-expected.txt + awk '{ \ + "grep \"^export sort=\" " $$1 "/*.conf | wc -l" | getline cnt; \ + printf "%s\t%s\n", $$1, cnt+1; \ + }' src/sort-expected.txt > $@ + +check-sorting: src/sort-expected.txt src/sort-given.txt + diff -U10 src/sort-expected.txt src/sort-given.txt + + .SUFFIXES: .links-check-internal sources.links-check-internal = $(sources.adoc:.adoc=.links-check-internal) $(sources.links-check-internal): $(sources.html) @@ -286,7 +302,7 @@ check-external: check-links: check-internal check-external -check-unit: check-links +check-unit: check-sorting check-links integration-tests = \ |