From 7fa6cd45629db9db840f62ea1ac8361042fa40b3 Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Thu, 16 Aug 2018 09:36:48 -0700 Subject: [PATCH] Revert "test: remove manpage test" I root caused the issue with this test (fixed in the next commit). This reverts commit 4faee3855f872cf54a2d4e4b6716c335e653bc9b. --- Makefile.am | 1 + test/documentation/manpages/test.bats | 29 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 test/documentation/manpages/test.bats diff --git a/Makefile.am b/Makefile.am index 3b442f06..9ce70bbe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -111,6 +111,7 @@ BATS_LOG_DRIVER = $(tap_driver) TESTS = $(dist_check_SCRIPTS) BATS = \ + test/documentation/manpages/test.bats \ test/functional/bundleadd/add-directory/test.bats \ test/functional/bundleadd_v2/add-directory.bats \ test/functional/bundleadd/add-existing/test.bats \ diff --git a/test/documentation/manpages/test.bats b/test/documentation/manpages/test.bats new file mode 100755 index 00000000..e67e21c1 --- /dev/null +++ b/test/documentation/manpages/test.bats @@ -0,0 +1,29 @@ +#!/usr/bin/env bats + +setup() { + # Ensure that we have the conversion program + type -t rst2man.py > /dev/null + # Change to the toplevel git directory + type -t git >/dev/null || skip + cd "$(git rev-parse --show-toplevel)" +} + +@test "Check manual pages are up to date" { + for rst in docs/*.[1-9].rst + do + [ -f "$rst" ] || continue # Could use shopt -s nullglob + echo "$rst" + rst2man.py "$rst" | cmp "${rst%.rst}" - + done +} + +@test "Check manual pages are clean" { + for nroff in docs/*.[1-9] + do + [ -f "$nroff" ] || continue + echo "$nroff" + git diff-index --quiet HEAD "$nroff" + done +} + +# vi: ft=sh ts=8 sw=2 sts=2 et tw=80