Imported Upstream version 1.8.8
[platform/upstream/doxygen.git] / testing / 062_namespace_resolution.tcl
1 #// objective: tests correct namespace resolution, only references/referencedby relations are relevant
2 #// check: namespacen1.xml
3 #// check: namespacen2.xml
4 #// check: namespacen3.xml
5 #// config: REFERENCED_BY_RELATION = yes
6 #// config: REFERENCES_RELATION = yes
7 #// config: EXTRACT_ALL = yes
8 #// config: INLINE_SOURCES = yes
9
10 # now: combine namespace eval and qualified names
11 namespace eval n1 {
12     proc p1 args {
13         array set info [info frame 0]; puts -nonewline ->$info(proc)
14         p2
15         return
16     }
17     proc p2 args {
18         array set info [info frame 0]; puts -nonewline ->$info(proc)
19         return
20     }
21     namespace eval n1 {
22         proc p1 args {
23             array set info [info frame 0]; puts -nonewline ->$info(proc)
24             return
25         }
26     }
27 }
28 # same thing, but fully qualified proc names
29 namespace eval ::n2 {}
30 namespace eval ::n2::n2 {}
31 proc ::n2::p1 args {
32     array set info [info frame 0]; puts -nonewline ->$info(proc)
33     p2
34     return
35 }
36 proc ::n2::p2 args {
37     array set info [info frame 0]; puts -nonewline ->$info(proc)
38     return
39 }
40 proc ::n2::n2::p2 args {
41     array set info [info frame 0]; puts -nonewline ->$info(proc)
42     return
43 }
44 # same thing, without leading ::
45 namespace eval n3 {}
46 namespace eval n3::n3 {}
47 proc n3::p1 args {
48     array set info [info frame 0]; puts -nonewline ->$info(proc)
49     p2
50     return
51 }
52 proc n3::p2 args {
53     array set info [info frame 0]; puts -nonewline ->$info(proc)
54     return
55 }
56 proc n3::n3::p2 args {
57     array set info [info frame 0]; puts -nonewline ->$info(proc)
58     return
59 }
60 # now, check with tcl what is called
61 n1::p1
62 puts ""
63 n2::p1
64 puts ""
65 n3::p1
66 puts ""
67 exit
68