| 1 |
#%Module1.0 |
| 2 |
|
| 3 |
############################################################################## |
| 4 |
# Modules Revision 3.0 |
| 5 |
# Providing a flexible user environment |
| 6 |
# |
| 7 |
# File: spreadrc/%M% |
| 8 |
# Revision: %I% |
| 9 |
# First Edition: 2017/06/20 |
| 10 |
# Last Mod.: %U%, %G% |
| 11 |
# |
| 12 |
# Authors: Xavier Delaruelle, [email protected] |
| 13 |
# |
| 14 |
# Description: Testuite modulefile |
| 15 |
# Command: |
| 16 |
# Sub-Command: |
| 17 |
# |
| 18 |
# Invocation: load @M@, unload @M@, switch @M@ @M@, |
| 19 |
# help @M@, display @M@, test @M@, whatis @M@ |
| 20 |
# Result: %R{ |
| 21 |
# }R% |
| 22 |
# Comment: %C{ |
| 23 |
# Test how variable and procedure definitions spread from |
| 24 |
# one modulerc or modulefile interpretation to another one. |
| 25 |
# }C% |
| 26 |
# |
| 27 |
############################################################################## |
| 28 |
|
| 29 |
|
| 30 |
# test if specific or overridden pre-existing variables have spread here |
| 31 |
# coming from modulerc or sibbling modulefiles |
| 32 |
if {[info exists spreadrc]} { |
| 33 |
puts stderr "variable spreadrc exists" |
| 34 |
} |
| 35 |
if {[info exists spreadmod]} { |
| 36 |
puts stderr "variable spreadmod exists" |
| 37 |
} |
| 38 |
if {$tcl_version eq "test"} { |
| 39 |
puts stderr "variable tcl_version equals test" |
| 40 |
} |
| 41 |
if {[array exists spreadrc_array]} { |
| 42 |
puts stderr "array variable spreadrc_array exists" |
| 43 |
} |
| 44 |
if {[array exists spreadmod_array]} { |
| 45 |
puts stderr "array variable spreadmod_array exists" |
| 46 |
} |
| 47 |
if {$tcl_platform(osVersion) eq "test"} { |
| 48 |
puts stderr "variable tcl_platform(osVersion) equals test" |
| 49 |
} |
| 50 |
if {[llength $auto_path] <= 1} { |
| 51 |
puts stderr "variable auto_path has lost elements" |
| 52 |
} |
| 53 |
if {[lsearch -exact $auto_path $env(TESTSUITEDIR)] > -1} { |
| 54 |
puts stderr "variable auto_path contains $env(TESTSUITEDIR)" |
| 55 |
} |
| 56 |
|
| 57 |
# test if specific or overridden interpreter alias command have spread here |
| 58 |
# coming from modulerc or sibbling modulefiles |
| 59 |
set existing_proc [lindex [info procs] 0] |
| 60 |
# test if first proc defined has been altered |
| 61 |
if {[info procs $existing_proc] ne $existing_proc} { |
| 62 |
puts stderr "procedure $existing_proc does not exist" |
| 63 |
# env variable spread across interpretation and even between interpreters |
| 64 |
} else { |
| 65 |
# overridden proc does not spread as interp is renewed when a command is overridden |
| 66 |
if {[info exists env(spreadmodcmd)] && [$existing_proc] eq "spreadmodcmd"} { |
| 67 |
puts stderr "procedure $existing_proc has been altered" |
| 68 |
} |
| 69 |
if {[info exists env(spreadrc)] && [$existing_proc] eq "spreadrc"} { |
| 70 |
puts stderr "procedure $existing_proc has been altered" |
| 71 |
} |
| 72 |
} |
| 73 |
if {[info procs spreadrc_proc] eq "spreadrc_proc"} { |
| 74 |
puts stderr "procedure spreadrc_proc exists" |
| 75 |
} |
| 76 |
if {[info procs spreadmod_proc] eq "spreadmod_proc"} { |
| 77 |
puts stderr "procedure spreadmod_proc exists" |
| 78 |
} |
| 79 |
if {[info procs ModulesHelp] eq "ModulesHelp"} { |
| 80 |
puts stderr "procedure ModulesHelp exists" |
| 81 |
} |
| 82 |
if {[info procs ModulesTest] eq "ModulesTest"} { |
| 83 |
puts stderr "procedure ModulesTest exists" |
| 84 |
} |
| 85 |
if {[info procs ModulesDisplay] eq "ModulesDisplay"} { |
| 86 |
puts stderr "procedure ModulesDisplay exists" |
| 87 |
} |
| 88 |
if {[info procs module-version] eq "module-version"} { |
| 89 |
puts stderr "procedure module-version exists" |
| 90 |
} |
| 91 |
if {[info commands set] ne "set"} { |
| 92 |
puts stderr "command set does not exist" |
| 93 |
} |
| 94 |
|