[PATCH hare] scripts: add test-genoiddb
Export this patch
to catch accidental breakages or format changes during build.
Signed-off-by: Armin Preiml <apreiml@strohwolke.at>
---
.builds/alpine.yml | 3 +++
scripts/test-genoiddb | 6 ++++++
2 files changed, 9 insertions(+)
create mode 100755 scripts/test-genoiddb
diff --git a/.builds/alpine.yml b/.builds/alpine.yml
index b9c95cce..1c484fde 100644
--- a/.builds/alpine.yml
+++ b/.builds/alpine.yml
@@ -60,6 +60,9 @@ tasks:
- lint: |
cd hare
./scripts/lint.sh
+ - test-genoiddb: |
+ cd hare
+ ./scripts/test-genoiddb
- bootstrap: |
cd hare
make -j2 bootstrap
diff --git a/scripts/test-genoiddb b/scripts/test-genoiddb
new file mode 100755
index 00000000..d3b8c1cd
--- /dev/null
+++ b/scripts/test-genoiddb
@@ -0,0 +1,6 @@
+ #!/bin/sh
+
+ hare run cmd/genoiddb < encoding/asn1/stdoid/db.txt \
+ | diff encoding/asn1/stdoid/db.ha - > /dev/null \
+ || (echo "Either something broke cmd/genoiddb or the database has to" \
+ "be generated again." ; exit 1)
Instead of `diff > /dev/null`, you can use `cmp -s`, which will
immediately exit if the files differ.
--
2.45.2
hare/patches: SUCCESS in 1m11s
[scripts: add test-genoiddb][0] from [Armin Preiml][1]
[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/54136
[1]: mailto:apreiml@strohwolke.at
✓ #1287731 SUCCESS hare/patches/openbsd.yml https://builds.sr.ht/~sircmpwn/job/1287731
✓ #1287729 SUCCESS hare/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/1287729
✓ #1287730 SUCCESS hare/patches/netbsd.yml https://builds.sr.ht/~sircmpwn/job/1287730
✓ #1287728 SUCCESS hare/patches/alpine.yml https://builds.sr.ht/~sircmpwn/job/1287728
i'd recommend hooking this into the same infrastructure we use for make
bootstrap: regenerate the ioddb in the ci build, then let it error out
when the git status turns out dirty