]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - t/test-lib.sh
test suite: Add sanity check for generated man pages.
[paraslash.git] / t / test-lib.sh
index b7d675ea0def671529e13732c52143bb22290288..f3768b65d573f755ea505bf282a1e106809621a2 100644 (file)
@@ -162,7 +162,7 @@ test_duration()
 test_expect_success()
 {
        (($# != 2)) && error "bug: not 2 parameters to test_expect_success()"
-       say >&3 "expecting success: $2"
+       echo >&3 "expecting success: $2"
        _test_run "$1" "$2" "success"
        echo >&3 ""
 }
@@ -170,7 +170,7 @@ test_expect_success()
 test_expect_failure()
 {
        (($# != 2)) && error "bug: not 2 parameters to test_expect_failure()"
-       say >&3 "expecting failure: $2"
+       echo >&3 "expecting failure: $2"
        _test_run "$1" "$2" "failure"
        echo >&3 ""
 }
@@ -235,6 +235,7 @@ parse_options()
                -v=1|--verbose=1) o_verbose="1"; shift;;
                -v|--verbose|-v=2|--verbose=2) o_verbose="2"; shift;;
                --no-color) o_nocolor="true"; shift;;
+               --man-dir) export o_man_dir="$2"; shift; shift;;
                --results-dir) o_results_dir="$2"; shift; shift;;
                --trash-dir) o_trash_dir="$2"; shift; shift;;
                --executables-dir) export o_executables_dir="$2"; shift; shift;;
@@ -265,11 +266,13 @@ fixup_dirs()
        [[ -z "$o_results_dir" ]] && o_results_dir="$test_dir/test-results"
        [[ -z "$o_executables_dir" ]] && o_executables_dir="$test_dir/.."
        [[ -z "$o_trash_dir" ]] && o_trash_dir="$test_dir/trashes"
+       [[ -z "$o_man_dir" ]] && o_man_dir="$test_dir/../build/man/man1"
 
        # we want alsolute paths because relative paths become invalid
        # after changing to the trash dir
        [[ -n "${o_results_dir##/*}" ]] && o_results_dir="$wd/$o_results_dir"
        [[ -n "${o_executables_dir##/*}" ]] && o_executables_dir="$wd/$o_results_dir"
+       [[ -n "${o_man_dir##/*}" ]] && o_man_dir="$wd/$o_man_dir"
        [[ -n "${o_trash_dir##/*}" ]] && o_trash_dir="$wd/$o_trash_dir"
 
        mkdir -p "$o_results_dir"