Tcl Source Code

Check-in [41e62e1505]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:
* tests/NRE.test: better constraint for testing the * tests/stack.test: existence of teststacklimit, to insure that the testsuite runs under tclsh.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 41e62e150560780d43c91ad6e2de4ac844041bea
User & Date: msofer 2008-07-16 00:44:38
Context
2008-07-16
22:08
NRE-aware TclOO. check-in: a8d83acd18 user: dkf tags: trunk, potential incompatibility
00:44
* tests/NRE.test: better constraint for testing the * tests/stack.test: existence of teststack...
check-in: 41e62e1505 user: msofer tags: trunk
2008-07-15
14:13
* generic/tclParse.c: fixing incomplete reversion of "fix" for [Bug 2017583], missing TclResetCanc...
check-in: 34b2654de3 user: msofer tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1
2




3
4
5
6
7
8
9
2008-07-15  Miguel Sofer  <[email protected]>





	* generic/tclParse.c: fixing incomplete reversion of "fix" for
	[Bug 2017583], missing TclResetCancellation call. 

2008-07-15  Donal K. Fellows  <[email protected]>

	* generic/tclBasic.c (Tcl_CancelEval): Fix blunder. [Bug 2018603]


>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2008-07-15  Miguel Sofer  <[email protected]>

	* tests/NRE.test:    better constraint for testing the 
	* tests/stack.test:  existence of teststacklimit, to insure that
	                     the testsuite runs under tclsh.
	
	* generic/tclParse.c: fixing incomplete reversion of "fix" for
	[Bug 2017583], missing TclResetCancellation call. 

2008-07-15  Donal K. Fellows  <[email protected]>

	* generic/tclBasic.c (Tcl_CancelEval): Fix blunder. [Bug 2018603]

Changes to tests/NRE.test.

4
5
6
7
8
9
10
11
12
13
14
15
16
17



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
...
296
297
298
299
300
301
302
303
304
305
306
307
308
# avoids recursive calls to TEBC.
#
# Copyright (c) 2008 by Miguel Sofer.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: NRE.test,v 1.1 2008/07/13 09:04:54 msofer Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import -force ::tcltest::*
}




if {[testConstraint unix]} {
    #
    # Workaround for gnu-make bug http://savannah.gnu.org/bugs/?18396
    #
    # Do not let make set up too large a C stack for us, as it effectively
    # disables the tests under some circumstances
    #

    set oldLimit [teststacklimit 2048]
}


testConstraint tailcall [llength [info commands ::tcl::unsupported::tailcall]]

#
# The first few tests will blow the C stack if the NR machinery is not working
# properly: all these calls should execute within the same instance of TEBC,
# and thus do not load the C stack. The nesting limit is given by how much the
# Tcl execution stack can grow. 
#

................................................................................
#



# cleanup
::tcltest::cleanupTests

if {[testConstraint unix]} {
    teststacklimit $oldLimit
}


return






|






>
>
>
|











<
<







 







|





4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32


33
34
35
36
37
38
39
...
297
298
299
300
301
302
303
304
305
306
307
308
309
# avoids recursive calls to TEBC.
#
# Copyright (c) 2008 by Miguel Sofer.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: NRE.test,v 1.2 2008/07/16 00:44:44 msofer Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import -force ::tcltest::*
}

testConstraint tailcall [llength [info commands ::tcl::unsupported::tailcall]]
testConstraint teststacklimit [llength [info commands teststacklimit]]

if {[testConstraint teststacklimit]} {
    #
    # Workaround for gnu-make bug http://savannah.gnu.org/bugs/?18396
    #
    # Do not let make set up too large a C stack for us, as it effectively
    # disables the tests under some circumstances
    #

    set oldLimit [teststacklimit 2048]
}




#
# The first few tests will blow the C stack if the NR machinery is not working
# properly: all these calls should execute within the same instance of TEBC,
# and thus do not load the C stack. The nesting limit is given by how much the
# Tcl execution stack can grow. 
#

................................................................................
#



# cleanup
::tcltest::cleanupTests

if {[testConstraint teststacklimit]} {
    teststacklimit $oldLimit
}


return

Changes to tests/stack.test.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
20
21
22
23
24
25
26


27

28



29
30
31
32
33
34
35
# generates output for errors.  No output means no errors were found.
#
# Copyright (c) 1998-2000 Ajuba Solutions.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: stack.test,v 1.23 2008/07/13 09:03:36 msofer Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# Note that a failure in this test results in a crash of the executable.
................................................................................
# In order to avoid that, we do a basic check of the current stacksize.
# This size can be changed with ulimit (ksh/bash/sh) or limit (csh/tcsh).

# This doesn't catch all cases, for example threads of lower stacksize
# can still squeak through.  A core check is really needed. -- JH

testConstraint minStack2400 1


if {[testConstraint unix]} {

    set stackSize [teststacklimit]



    if {($stackSize > -1)  && ($stackSize < 2400)} {
        puts stderr "WARNING: the default application stacksize of $stackSize\
                may cause Tcl to\ncrash due to stack overflow before the\
                recursion limit is reached.\nA minimum stacksize of 2400\
                kbytes is recommended.\nSkipping infinite recursion test."
        testConstraint minStack2400 0
    }






|







 







>
>

>
|
>
>
>







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# generates output for errors.  No output means no errors were found.
#
# Copyright (c) 1998-2000 Ajuba Solutions.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: stack.test,v 1.24 2008/07/16 00:44:44 msofer Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# Note that a failure in this test results in a crash of the executable.
................................................................................
# In order to avoid that, we do a basic check of the current stacksize.
# This size can be changed with ulimit (ksh/bash/sh) or limit (csh/tcsh).

# This doesn't catch all cases, for example threads of lower stacksize
# can still squeak through.  A core check is really needed. -- JH

testConstraint minStack2400 1
testConstraint teststacklimit [llength [info commands teststacklimit]]

if {[testConstraint unix]} {
    if {[testConstraint teststacklimit]} {
	set stackSize [teststacklimit]
    } else {
	set stackSize [exec /bin/sh -c "ulimit -s"]
    }
    if {($stackSize > -1)  && ($stackSize < 2400)} {
        puts stderr "WARNING: the default application stacksize of $stackSize\
                may cause Tcl to\ncrash due to stack overflow before the\
                recursion limit is reached.\nA minimum stacksize of 2400\
                kbytes is recommended.\nSkipping infinite recursion test."
        testConstraint minStack2400 0
    }