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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [itk/] [tests/] [interp.test] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#
2
# Tests for using [incr Tcl] in slave interpreters
3
# ----------------------------------------------------------------------
4
#   AUTHOR:  Michael J. McLennan
5
#            Bell Labs Innovations for Lucent Technologies
6
#            mmclennan@lucent.com
7
#            http://www.tcltk.com/itcl
8
#
9
#      RCS:  $Id: interp.test,v 1.1.1.1 2002-01-16 10:24:48 markom Exp $
10
# ----------------------------------------------------------------------
11
#            Copyright (c) 1993-1998  Lucent Technologies, Inc.
12
# ======================================================================
13
# See the file "license.terms" for information on usage and
14
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
 
16
if {[string compare test [info procs test]] == 1} then {source defs}
17
 
18
# ----------------------------------------------------------------------
19
#  Make sure that slave interpreters can be created and loaded
20
#  with [incr Tcl] / [incr Tk]...
21
# ----------------------------------------------------------------------
22
test interp-1.1 {create a slave interp with [incr Tk]} {
23
    interp create slave
24
    load "" Itcl slave
25
    load "" Tk slave
26
    load "" Itk slave
27
    list [slave eval "namespace children :: ::itk"] [interp delete slave]
28
} {::itk {}}
29
 
30
test interp-1.2 {can't load [incr Tk] into a safe interp} {
31
    interp create -safe slave
32
    load "" Itcl slave
33
    set result [list [catch {load "" Itk slave} msg] $msg]
34
    interp delete slave
35
    set result
36
} {1 {can't use package in a safe interpreter: no Itk_SafeInit procedure}}
37
 
38
test interp-1.3 {errors are okay when slave interp is deleted} {
39
    interp create slave
40
    load "" Itcl slave
41
    load "" Tk slave
42
    load "" Itk slave
43
    slave eval {
44
        label .l
45
        bind .l  {error "dying!"}
46
    }
47
    interp delete slave
48
} {}

powered by: WebSVN 2.1.0

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