summaryrefslogtreecommitdiffstats
path: root/testing/059_command_catch.tcl
diff options
context:
space:
mode:
authorPetr Prikryl <prikryl@atlas.cz>2014-07-29 07:09:52 (GMT)
committerPetr Prikryl <prikryl@atlas.cz>2014-07-29 07:09:52 (GMT)
commite38b1f7685bfa4a301a96d09034dd940c2153aed (patch)
tree3571bd0400ecd959bddd686ab1e92019b0808889 /testing/059_command_catch.tcl
parent1ccc93fd699b34b7a89acecf9e59a526a5972bb8 (diff)
parentc9d816aaf20c24c624407ba1c2eb4e00eff0c02f (diff)
downloadDoxygen-e38b1f7685bfa4a301a96d09034dd940c2153aed.zip
Doxygen-e38b1f7685bfa4a301a96d09034dd940c2153aed.tar.gz
Doxygen-e38b1f7685bfa4a301a96d09034dd940c2153aed.tar.bz2
Merge branch 'master' of https://github.com/doxygen/doxygen.git
Diffstat (limited to 'testing/059_command_catch.tcl')
-rw-r--r--testing/059_command_catch.tcl87
1 files changed, 87 insertions, 0 deletions
diff --git a/testing/059_command_catch.tcl b/testing/059_command_catch.tcl
new file mode 100644
index 0000000..4227da7
--- /dev/null
+++ b/testing/059_command_catch.tcl
@@ -0,0 +1,87 @@
+#// objective: tests processing of catch/eval, only references/referencedby relations are relevant
+#// check: 059__command__catch_8tcl.xml
+#// config: REFERENCED_BY_RELATION = yes
+#// config: REFERENCES_RELATION = yes
+#// config: EXTRACT_ALL = yes
+#// config: INLINE_SOURCES = no
+
+##
+# \brief should be reference by every proc below
+proc Invoked args {
+ puts "Procedure \"Invoked\" is invoked indeed. Ok."
+ return $args
+}
+##
+# \brief must not be reference by every proc below
+proc NotInvoked args {
+ puts "Procedure \"NotInvoked\" is invoked. Not Ok!"
+ return $args
+}
+#
+# check if call references work at all
+proc a args {
+ Invoked NotInvoked
+ return
+}
+#
+# catch command
+# Tcl8.5: catch script ?resultVarName? ?optionsVarName?
+proc b args {
+ catch Invoked
+ return
+}
+proc c args {
+ catch Invoked NotInvoked
+ return
+}
+proc d args {
+ catch Invoked NotInvoked NotInvoked
+ return
+}
+proc e args {
+ set r [catch Invoked NotInvoked NotInvoked]
+ return
+}
+proc f args {
+ set r [catch {Invoked} NotInvoked NotInvoked]
+ return
+}
+proc g args {
+ set r [catch {
+ set x [Invoked]
+ } NotInvoked NotInvoked]
+ return
+}
+# eval arg ?arg ...?
+proc h args {
+ eval Invoked NotInvoked
+ return
+}
+proc i args {
+ eval set NotInvoked [Invoked NotInvoked]
+ return
+}
+# This is a striped down example. Original:
+#
+# jpeg.tcl --
+#
+# Querying and modifying JPEG image files.
+#
+# Copyright (c) 2004 Aaron Faupell <afaupell@users.sourceforge.net>
+#
+# ...
+# eval [list addComment $file] [lreplace $com 0 0 $comment]
+# ...
+proc j args {
+ eval [list set] [list NotInvoked] [Invoked NotInvoked]
+ return
+}
+#
+# call all single letter procs
+# let tcl check what is called and what is not called
+foreach p [info procs ?] {
+ puts "Check procedure \"$p\""
+ $p
+}
+exit
+