Debian Codegraph @

testsuite/modulefiles/spread/6.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/21
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 when these
25 # interpretations are cascaded.
26 # }C%
27 #
28 ##############################################################################
29
30
31 # test if specific or overridden pre-existing variables have spread here
32 if {[info exists spread]} {
33 puts stderr "variable spread exists"
34 }
35 if {$tcl_version eq "test"} {
36 puts stderr "variable tcl_version equals test"
37 }
38 if {[array exists spread_array]} {
39 puts stderr "array variable spread_array exists"
40 }
41 if {$tcl_platform(osVersion) eq "test"} {
42 puts stderr "variable tcl_platform(osVersion) equals test"
43 }
44 if {[llength $auto_path] <= 1} {
45 puts stderr "variable auto_path has lost elements"
46 }
47 if {[lsearch -exact $auto_path $env(TESTSUITEDIR)] > -1} {
48 puts stderr "variable auto_path contains $env(TESTSUITEDIR)"
49 }
50
51 # test if specific or overridden interpreter alias command have spread here
52 set existing_proc [lindex [info procs] 0]
53 # test if first proc defined has been altered
54 if {[info procs $existing_proc] ne $existing_proc} {
55 puts stderr "procedure $existing_proc does not exist"
56 # env variable spread across interpretation and even between interpreters
57 # overridden proc does not spread as cascaded interpretation occurs in a
58 # different interpreter
59 } elseif {[info exists env(spreadcasc)] && [$existing_proc] eq "spreadcasc"\
60 && [module-info mode] ni {whatis scan}} {
61 puts stderr "procedure $existing_proc has been altered"
62 }
63 if {[info procs spread_proc] eq "spread_proc"} {
64 puts stderr "procedure spread_proc exists"
65 }
66 if {[info procs ModulesHelp] eq "ModulesHelp"} {
67 puts stderr "procedure ModulesHelp exists"
68 }
69 if {[info procs ModulesTest] eq "ModulesTest"} {
70 puts stderr "procedure ModulesTest exists"
71 }
72 if {[info procs ModulesDisplay] eq "ModulesDisplay"} {
73 puts stderr "procedure ModulesDisplay exists"
74 }
75 if {[info procs module-version] eq "module-version"} {
76 puts stderr "procedure module-version exists"
77 }
78
79 setenv testspreadsub "yes"