From 9d3646eaee37dcfe6b5a44ebdf7380b5684f3c7b Mon Sep 17 00:00:00 2001 From: pooryorick Date: Sat, 23 Mar 2024 23:34:58 +0000 Subject: A new test constraint, "bigmem", configurable via the environment variable TCL_TESTCONSTRAINT_BIGMEM, to bypass tests that require large amounts of memory. --- tests/binary.test | 4 +++- tests/tcltests.tcl | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/binary.test b/tests/binary.test index 299e1e0..da25cd9 100644 --- a/tests/binary.test +++ b/tests/binary.test @@ -3048,7 +3048,9 @@ test binary-80.3 {Tcl_GetBytesFromObj} -constraints testbytestring -returnCodes test binary-80.4 {Tcl_GetBytesFromObj} -constraints testbytestring -returnCodes 1 -body { testbytestring [testbytestring "\xC0\x80\xA0\xA0\xA0\xF0\x9F\x98\x81"] } -result "expected byte sequence but character 4 was '\U01F601' (U+01F601)" -test binary-80.5 {Tcl_GetBytesFromObj} -constraints {testbytestring pointerIs64bit deprecated} -body { +test binary-80.5 {Tcl_GetBytesFromObj} -constraints { + bigmem testbytestring pointerIs64bit deprecated +} -body { testbytestring [string repeat A [expr 2**31]] } -returnCodes 1 -result "byte sequence length exceeds INT_MAX" diff --git a/tests/tcltests.tcl b/tests/tcltests.tcl index 409a2cc..50ea9d1 100644 --- a/tests/tcltests.tcl +++ b/tests/tcltests.tcl @@ -15,6 +15,11 @@ testConstraint debugpurify [ && [testConstraint debug] && [testConstraint purify] }] +testConstraint bigmem [expr {[ + info exists ::env(TCL_TESTCONSTRAINT_BIGMEM)] + ? !!$::env(TCL_TESTCONSTRAINT_BIGMEM) + : 1 +}] testConstraint fcopy [llength [info commands fcopy]] testConstraint fileevent [llength [info commands fileevent]] testConstraint thread [expr {![catch {package require Thread 2.7-}]}] -- cgit v0.12