diff options
author | Jason Molenda <jmolenda@apple.com> | 1999-11-09 01:28:43 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 1999-11-09 01:28:43 +0000 |
commit | eceff73081bb2d5ebd624f6e2b775e93c4c7b298 (patch) | |
tree | ee2bc71d61f78dbfdf494640cfb678822e101cef /tcl/tests/autoMkindex.test | |
parent | 69a7b5f79888513741e65a54216d7756474b76c2 (diff) | |
download | gdb-dejagnu-1999-11-08.tar.gz |
import dejagnu-1999-11-08 snapshotdejagnu-1999-11-08
Diffstat (limited to 'tcl/tests/autoMkindex.test')
-rw-r--r-- | tcl/tests/autoMkindex.test | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/tcl/tests/autoMkindex.test b/tcl/tests/autoMkindex.test new file mode 100644 index 00000000000..9428f84d903 --- /dev/null +++ b/tcl/tests/autoMkindex.test @@ -0,0 +1,61 @@ +# Commands covered: auto_mkindex auto_import +# +# This file contains tests related to autoloading and generating +# the autoloading index. +# +# Copyright (c) 1998 Lucent Technologies, Inc. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: @(#) $Id$ + +if {[string compare test [info procs test]] == 1} then {source defs} + +test autoMkindex-1.1 {remove any existing tclIndex file} { + file delete tclIndex + file exists tclIndex +} {0} + +test autoMkindex-1.2 {build tclIndex based on a test file} { + auto_mkindex . autoMkindex.tcl + file exists tclIndex +} {1} + +set element "{source [file join . autoMkindex.tcl]}" + +test autoMkindex-1.3 {examine tclIndex} { + namespace eval tcl_autoMkindex_tmp { + set dir "." + variable auto_index + source tclIndex + set result "" + foreach elem [lsort [array names auto_index]] { + lappend result [list $elem $auto_index($elem)] + } + set result + } +} "{::buried::explicit $element} {::buried::inside $element} {::buried::pub_one $element} {::buried::pub_two $element} {::buried::relative $element} {::buried::under::neath $element} {::buried::within $element} {indented $element} {normal $element} {top $element}" + +namespace delete tcl_autoMkindex_tmp + +test autoMkindex-2.1 {commands on the autoload path can be imported} { + set interp [interp create] + set final [$interp eval { + namespace eval blt {} + set auto_path [linsert $auto_path 0 .] + set info [list [catch {namespace import buried::*} result] $result] + foreach name [lsort [info commands pub_*]] { + lappend info $name [namespace origin $name] + } + set info + }] + interp delete $interp + set final +} "0 {} pub_one ::buried::pub_one pub_two ::buried::pub_two" + +# +# Clean up. +# + +catch {file delete tclIndex} |