1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 13:44:14 +01:00

build: Add doctest make target

Running `make doctest` will make sure the manual page is synchronized with the
available options.
This commit is contained in:
Olof Johansson 2015-03-22 18:00:25 +01:00
parent 7cde2ca8e7
commit 47b05a245d
2 changed files with 8 additions and 6 deletions

View File

@ -1,6 +1,6 @@
all: svtplay-dl
.PHONY: test cover pylint svtplay-dl
.PHONY: test cover doctest pylint svtplay-dl
VERSION = 0.10.$(shell date +%Y.%m.%d)
@ -53,6 +53,9 @@ cover:
pylint:
$(MAKE) -C lib pylint
doctest: svtplay-dl
sh scripts/diff_man_help.sh
clean:
$(MAKE) -C lib clean
rm -f svtplay-dl

View File

@ -1,7 +1,5 @@
#!/bin/sh
# Make sure the options listed in --help and the manual are in sync.
diff_opts="$@"
diff_opts=${diff_opts:-"-u"}
TMPDIR=$(mktemp -d svtplay-man-test-XXXXXX)
[ "$TMPDIR" ] || {
echo "mktemp not available, using static dir"
@ -35,6 +33,7 @@ for file in $TMPDIR/options.*; do
perl -i -pe 's/^(-.(?: [^-][^ ]+)?) (--.*)/\2 \1/' $file
done
# There should be no difference.
diff $diff_opts $TMPDIR/options.*
#sha1sum $TMPDIR/options.*
[ "$(sha1sum<$TMPDIR/options.help)" = "$(sha1sum<$TMPDIR/options.man)" ] || {
diff -u $TMPDIR/options.help $TMPDIR/options.man
exit 1
}