##############################################################################
#   Modules Revision 3.0
#   Providing a flexible user environment
#
#   File:		modules.35-trace/%M%
#   Revision:		%I%
#   First Edition:	1995/12/06
#   Last Mod.:		%U%, %G%
#
#   Authors:		Jens Hamisch, Jens.Hamisch@Strawberry.COM
#
#   Description:	Testuite testsequence
#   Command:		load
#   Modulefiles:	trace/all_off, trace/disptrac
#   Sub-Command:
#
#   Comment:	%C{
#			Turns tracing off for all known module commands and
#			checks the resulting trace patterns
#		}C%
#
##############################################################################

#
#  Variables. This test forces a module load command. It will result in the
#    environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
#    be set up
#

set module "trace/all_off"
set modulefile "$env(MODULEPATH)/$module"

set disp_module "trace/disptrac"
set disp_modulefile "$env(MODULEPATH)/$disp_module"

#
#  setenv commands we expect to see
#

set tr_ap "setenv trace_apropos -.\\* ;"
set tr_av "setenv trace_avail -.\\* ;"
set tr_cl "setenv trace_clear -.\\* ;"
set tr_di "setenv trace_display -.\\* ;"
set tr_he "setenv trace_help -.\\* ;"
set tr_in "setenv trace_init -.\\* ;"
set tr_li "setenv trace_list -.\\* ;"
set tr_ld "setenv trace_load -.\\* ;"
set tr_pu "setenv trace_purge -.\\* ;"
set tr_sw "setenv trace_switch -.\\* ;"
set tr_ul "setenv trace_unload -.\\* ;"
set tr_un "setenv trace_unuse -.\\* ;"
set tr_up "setenv trace_update -.\\* ;"
set tr_us "setenv trace_use -.\\* ;"
set tr_wi "setenv trace_whatis -.\\* ;"

#
#  We only check for csh ...
#
set lmf "setenv _LMFILES_ $modulefile:$disp_modulefile ;"
set lm "setenv LOADEDMODULES $module:$disp_module ;"

set exp "$lm$lmf$tr_ap$tr_av$tr_cl$tr_di$tr_he$tr_in$tr_li"
set exp "$exp$tr_ld$tr_pu$tr_sw$tr_ul$tr_un$tr_up$tr_us$tr_wi"

#
#  The tests
#

test_cmd "csh" "load $module trace/disptrac" "$exp"

#
#  Cleanup
#

unset lm
unset lmf
unset exp

unset disp_modulefile
unset disp_module

unset modulefile
unset module
