| 1 |
############################################################################## |
| 2 |
# Modules Revision 3.0 |
| 3 |
# Providing a flexible user environment |
| 4 |
# |
| 5 |
# File: modules.70-maint/%M% |
| 6 |
# Revision: %I% |
| 7 |
# First Edition: 95/12/06 |
| 8 |
# Last Mod.: %U%, %G% |
| 9 |
# |
| 10 |
# Authors: Jens Hamisch, [email protected] |
| 11 |
# |
| 12 |
# Description: Testuite testsequence |
| 13 |
# Command: apropos |
| 14 |
# Modulefiles: whatis/lines, whatis/multiple, whatis/none, |
| 15 |
# Modulefiles: whatis/string, bad |
| 16 |
# Sub-Command: |
| 17 |
# |
| 18 |
# Comment: %C{ |
| 19 |
# Checks the 'module apropos' command. The first |
| 20 |
# invocation creates an apropos cache (which has been |
| 21 |
# removed while initialization of this part of the |
| 22 |
# testsuite), the second one searches case insensitive |
| 23 |
# through the cache and the last one looks up a non- |
| 24 |
# existing pattern. |
| 25 |
# }C% |
| 26 |
# |
| 27 |
############################################################################## |
| 28 |
|
| 29 |
# |
| 30 |
# Test only for the csh |
| 31 |
# |
| 32 |
|
| 33 |
set header "$modlin $modpathre $modlin" |
| 34 |
|
| 35 |
set warn_opt "$warn_msgs: Unsupported option " |
| 36 |
|
| 37 |
set ts_1 " whatis/lines: Testsuite Whatis Modulefile" |
| 38 |
set ts_1a " whatis/lines: Second line of whatis tokens" |
| 39 |
# different behavior than C-version: on Tcl-version multiple arguments provided on a single |
| 40 |
# module-whatis call produce a single module-whatis line, not one line per passed argument |
| 41 |
set ts_2 " whatis/multiple: Testsuite Whatis Modulefile" |
| 42 |
set ts_3 " whatis/none: Whatis" |
| 43 |
set ts_4 " whatis/string: Testsuite Whatis Modulefile" |
| 44 |
set ts_5 " bad/after: erroneous module test" |
| 45 |
set ts_6 " bad2/body: erroneous module test" |
| 46 |
set ts_7 " bad2/proc: erroneous module test" |
| 47 |
|
| 48 |
# |
| 49 |
# The tests |
| 50 |
# |
| 51 |
|
| 52 |
# expect a break message |
| 53 |
# error found in interpreted module, so an error code is rendered |
| 54 |
testouterr_cmd_re "csh" "apropos Whatis" "ERR" "$header\n$ts_1\n$ts_1a\n$ts_2\n$ts_4" |
| 55 |
|
| 56 |
skip_if_quick_mode |
| 57 |
|
| 58 |
# different behavior than C-version: on Tcl-version -i/--icase option is ignored |
| 59 |
# but search is always case insensitive |
| 60 |
testouterr_cmd_re "csh" "apropos WHATIS" "ERR" "$header\n$ts_1\n$ts_1a\n$ts_2\n$ts_4" |
| 61 |
testouterr_cmd_re "csh" "-i apropos WHATIS" "ERR" "$header\n$ts_1\n$ts_1a\n$ts_2\n$ts_4" |
| 62 |
testouterr_cmd_re "csh" "--icase apropos WHATIS" "ERR" "$header\n$ts_1\n$ts_1a\n$ts_2\n$ts_4" |
| 63 |
testouterr_cmd "csh" "apropos sdlhasdh" "ERR" "" |
| 64 |
|
| 65 |
# display all whatis lines as soon as one match search |
| 66 |
testouterr_cmd_re "csh" "apropos token" "ERR" "$header\n$ts_1\n$ts_1a" |
| 67 |
|
| 68 |
# command nickname tests |
| 69 |
testouterr_cmd_re "csh" "keyword token" "ERR" "$header\n$ts_1\n$ts_1a" |
| 70 |
testouterr_cmd_re "csh" "search token" "ERR" "$header\n$ts_1\n$ts_1a" |
| 71 |
|
| 72 |
# |
| 73 |
# test with erroneous modulefile |
| 74 |
# should not produce error message |
| 75 |
# |
| 76 |
testouterr_cmd_re "csh" "apropos erroneous" "ERR" "$header\n$ts_5\n$ts_6\n$ts_7" |
| 77 |
|
| 78 |
# same test in debug mode, should produce error message |
| 79 |
testouterr_cmd_re "csh" "-D apropos erroneous" "ERR" "(DEBUG .*)+\n$moderr_msgs:.*$header\n$ts_5\n$ts_6\n$ts_7\nDEBUG unsetState: report_sep_next unset\n\n(DEBUG .*)+" |
| 80 |
|
| 81 |
# |
| 82 |
# Cleanup |
| 83 |
# |
| 84 |
|
| 85 |
reset_test_env |