Debian Codegraph @

testsuite/modulefiles/spread/4.0

raw
1 #%Module1.0
2
3 ##############################################################################
4 # Modules Revision 3.0
5 # Providing a flexible user environment
6 #
7 # File: spread/%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 modulefile interpretation to another one.
25 # }C%
26 #
27 ##############################################################################
28
29
30 # test if specific or overridden pre-existing variables have spread here
31 if {[info exists spread]} {
32 puts stderr "variable spread exists"
33 }
34 if {$tcl_version eq "test"} {
35 puts stderr "variable tcl_version equals test"
36 }
37 if {[array exists spread_array]} {
38 puts stderr "array variable spread_array exists"
39 }
40 if {$tcl_platform(osVersion) eq "test"} {
41 puts stderr "variable tcl_platform(osVersion) equals test"
42 }
43 if {[llength $auto_path] <= 1} {
44 puts stderr "variable auto_path has lost elements"
45 }
46 if {[lsearch -exact $auto_path $env(TESTSUITEDIR)] > -1} {
47 puts stderr "variable auto_path contains $env(TESTSUITEDIR)"
48 }
49
50 # test if specific or overridden interpreter alias command have spread here
51 set existing_proc [lindex [info procs] 0]
52 # test if first proc defined has been altered
53 if {[info procs $existing_proc] ne $existing_proc} {
54 puts stderr "procedure $existing_proc does not exist"
55 # env variable spread across interpretation and even between interpreters
56 # overridden proc does not spread as interp is renewed when a command is overridden
57 } elseif {[info exists env(spreadcmd)] && [$existing_proc] eq "spreadcmd"} {
58 puts stderr "procedure $existing_proc has been altered"
59 }
60 if {[info procs spread_proc] eq "spread_proc"} {
61 puts stderr "procedure spread_proc exists"
62 }
63 if {[info procs ModulesHelp] eq "ModulesHelp"} {
64 puts stderr "procedure ModulesHelp exists"
65 }
66 if {[info procs ModulesTest] eq "ModulesTest"} {
67 puts stderr "procedure ModulesTest exists"
68 }
69 if {[info procs ModulesDisplay] eq "ModulesDisplay"} {
70 puts stderr "procedure ModulesDisplay exists"
71 }
72 if {[info procs module-version] eq "module-version"} {
73 puts stderr "procedure module-version exists"
74 }
75 if {[info commands set] ne "set"} {
76 puts stderr "command set does not exist"
77 }
78