OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [tests/] [autoMkindex.test] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Commands covered:  auto_mkindex auto_import
2
#
3
# This file contains tests related to autoloading and generating
4
# the autoloading index.
5
#
6
# Copyright (c) 1998  Lucent Technologies, Inc.
7
#
8
# See the file "license.terms" for information on usage and redistribution
9
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10
#
11
# RCS: @(#) $Id: autoMkindex.test,v 1.1.1.1 2002-01-16 10:25:35 markom Exp $
12
 
13
if {[string compare test [info procs test]] == 1} then {source defs}
14
 
15
test autoMkindex-1.1 {remove any existing tclIndex file} {
16
    file delete tclIndex
17
    file exists tclIndex
18
} {0}
19
 
20
test autoMkindex-1.2 {build tclIndex based on a test file} {
21
    auto_mkindex . autoMkindex.tcl
22
    file exists tclIndex
23
} {1}
24
 
25
set element "{source [file join . autoMkindex.tcl]}"
26
 
27
test autoMkindex-1.3 {examine tclIndex} {
28
    namespace eval tcl_autoMkindex_tmp {
29
        set dir "."
30
        variable auto_index
31
        source tclIndex
32
        set result ""
33
        foreach elem [lsort [array names auto_index]] {
34
            lappend result [list $elem $auto_index($elem)]
35
        }
36
        set result
37
    }
38
} "{::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}"
39
 
40
namespace delete tcl_autoMkindex_tmp
41
 
42
test autoMkindex-2.1 {commands on the autoload path can be imported} {
43
    set interp [interp create]
44
    set final [$interp eval {
45
        namespace eval blt {}
46
        set auto_path [linsert $auto_path 0 .]
47
        set info [list [catch {namespace import buried::*} result] $result]
48
        foreach name [lsort [info commands pub_*]] {
49
            lappend info $name [namespace origin $name]
50
        }
51
        set info
52
    }]
53
    interp delete $interp
54
    set final
55
} "0 {} pub_one ::buried::pub_one pub_two ::buried::pub_two"
56
 
57
#
58
# Clean up.
59
#
60
 
61
catch {file delete tclIndex}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.