#!/usr/bin/env bash test_description='Parse generated man pages. Simple sanity checks of some man pages. * para_audiod: Check that list of audiod commands is present * para_server: Check that list of server/afs commands is present * para_play: Check that list of play commands is present * para_{recv,filter,write,audiod}: Check for presence of filter/receiver/writer options as appropriate ' . ${0%/*}/test-lib.bash grep_man() { local regex="$1" exe="$2" tr '\n' ' ' < "$o_man_dir/para_$exe.1" | grep -q "$regex" } # check that options of all reveivers/filters/writers are contained # in the man pages test_expect_success 'para_recv: receiver options' "grep_man 'RECEIVERS' recv" test_expect_success 'para_filter: filter options' "grep_man 'FILTERS' filter" test_expect_success 'para_write: writer options' "grep_man 'WRITERS' write" test_require_objects "audiod" if [[ -n "$result" ]]; then test_skip 'para_audiod' "missing object(s): $result" else test_expect_success 'para_audiod: receivers' \ "grep_man 'RECEIVERS' audiod" test_expect_success 'para_audiod: filters' \ "grep_man 'FILTERS' audiod" test_expect_success 'para_audiod: writers' \ "grep_man 'WRITERS' audiod" fi # check various command lists test_require_objects "audiod" if [[ -n "$result" ]]; then test_skip 'para_audiod' "missing object(s): $result" else regex='LIST OF AUDIOD COMMANDS.\{200,\}' test_expect_success 'para_audiod: command list' \ "grep_man '$regex' audiod" fi test_require_objects "server" missing_objects="$result" if [[ -n "$missing_objects" ]]; then test_skip "para_server" "missing object(s): $missing_objects" else regex='LIST OF SERVER COMMANDS.\{100,\}' test_expect_success 'para_server: server/afs commands' \ "grep_man '$regex' server" fi test_require_objects 'play' missing_objects="$result" if [[ -n "$missing_objects" ]]; then test_skip 'para_play' "missing object(s): $missing_objects" else regex='LIST OF COMMANDS.\{100,\}' test_expect_success 'para_play: play commands' "grep_man '$regex' play" fi test_done