From 3501b86c9db5dfc701229f0388eb2c39b7f4aca3 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Thu, 20 Apr 2017 10:30:36 -0500 Subject: [PATCH] xfs/293: make test more robust xfs/293 is supposed to make sure every command in xfs_io is documented, but it was missing the inode command because it's a common word, and depending on how man formatted the page, the magic " inode" string could show up and appear to indicate that documentation is present for the command when it's not actually there. Change the test to inspect the manpage source directly, with the assumption that each documented command will start with ^\.B.*$COMMAND on a manpage line. This handles a few different compressed manpage formats - I don't know if anybody uses bz2 or xz, but hey. Signed-off-by: Eric Sandeen Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- tests/xfs/293 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/xfs/293 b/tests/xfs/293 index ade60154..df44e98e 100755 --- a/tests/xfs/293 +++ b/tests/xfs/293 @@ -48,8 +48,19 @@ _supported_os IRIX Linux echo "Silence is golden" +MANPAGE=`man --path xfs_io` + +case "$MANPAGE" in +*.gz|*.z\|*.Z) CAT=zcat;; +*.bz2) CAT=bzcat;; +*.xz) CAT=xzcat;; +*) CAT=cat;; +esac + +_require_command `which $CAT` $CAT + for COMMAND in `$XFS_IO_PROG -c help | awk '{print $1}' | grep -v "^Use"`; do - man xfs_io | col -b | grep -wq " $COMMAND" || \ + $CAT `man --path xfs_io` | egrep -q "^\.B.*$COMMAND" || \ echo "$COMMAND not documented in the xfs_io manpage" done -- 2.39.5