From 2d2b28f51aceca3697f87d716687214b7c860e7a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 8 Dec 2021 15:49:24 +0000 Subject: Update tcltest package to version 2.5.4 (backported from Tcl 8.7) --- library/tcltest/pkgIndex.tcl | 2 +- library/tcltest/tcltest.tcl | 26 ++++++++++++++++++++++---- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/library/tcltest/pkgIndex.tcl b/library/tcltest/pkgIndex.tcl index a56a0d6..da78df0 100644 --- a/library/tcltest/pkgIndex.tcl +++ b/library/tcltest/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5-]} {return} -package ifneeded tcltest 2.5.3 [list source [file join $dir tcltest.tcl]] +package ifneeded tcltest 2.5.4 [list source [file join $dir tcltest.tcl]] diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index dedcd7a..72c7b94 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -10,9 +10,9 @@ # initially implemented by Mary Ann May-Pumphrey of Sun # Microsystems. # -# Copyright (c) 1994-1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 Scriptics Corporation. -# Copyright (c) 2000 Ajuba Solutions +# Copyright © 1994-1997 Sun Microsystems, Inc. +# Copyright © 1998-1999 Scriptics Corporation. +# Copyright © 2000 Ajuba Solutions # Contributions from Don Porter, NIST, 2002. (not subject to US copyright) # All rights reserved. @@ -22,7 +22,7 @@ namespace eval tcltest { # When the version number changes, be sure to update the pkgIndex.tcl file, # and the install directory in the Makefiles. When the minor version # changes (new feature) be sure to update the man page as well. - variable Version 2.5.3 + variable Version 2.5.4 # Compatibility support for dumb variables defined in tcltest 1 # Do not use these. Call [package provide Tcl] and [info patchlevel] @@ -399,6 +399,9 @@ namespace eval tcltest { } default { set outputChannel [open $filename a] + if {[package vsatisfies [package provide Tcl] 8.7-]} { + fconfigure $outputChannel -encoding utf-8 + } set ChannelsWeOpened($outputChannel) 1 # If we created the file in [temporaryDirectory], then @@ -443,6 +446,9 @@ namespace eval tcltest { } default { set errorChannel [open $filename a] + if {[package vsatisfies [package provide Tcl] 8.7-]} { + fconfigure $errorChannel -encoding utf-8 + } set ChannelsWeOpened($errorChannel) 1 # If we created the file in [temporaryDirectory], then @@ -785,6 +791,9 @@ namespace eval tcltest { variable Option if {$Option(-loadfile) eq {}} {return} set tmp [open $Option(-loadfile) r] + if {[package vsatisfies [package provide Tcl] 8.7-]} { + fconfigure $tmp -encoding utf-8 + } loadScript [read $tmp] close $tmp } @@ -1330,6 +1339,9 @@ proc tcltest::DefineConstraintInitializers {} { ConstraintInitializer stdio { set code 0 if {![catch {set f [open "|[list [interpreter]]" w]}]} { + if {[package vsatisfies [package provide Tcl] 8.7-]} { + fconfigure $f -encoding utf-8 + } if {![catch {puts $f exit}]} { if {![catch {close $f}]} { set code 1 @@ -2177,6 +2189,9 @@ proc tcltest::test {name description args} { set testFile [file normalize [uplevel 1 {info script}]] if {[file readable $testFile]} { set testFd [open $testFile r] + if {[package vsatisfies [package provide Tcl] 8.7-]} { + fconfigure $testFd -encoding utf-8 + } set testLine [expr {[lsearch -regexp \ [split [read $testFd] "\n"] \ "^\[ \t\]*test [string map {. \\.} $name] "] + 1}] @@ -2885,6 +2900,9 @@ proc tcltest::runAllTests { {shell ""} } { if {[catch { incr numTestFiles set pipeFd [open $cmd "r"] + if {[package vsatisfies [package provide Tcl] 8.7-]} { + fconfigure $pipeFd -encoding utf-8 + } while {[gets $pipeFd line] >= 0} { if {[regexp [join { {^([^:]+):\t} diff --git a/unix/Makefile.in b/unix/Makefile.in index bb726ab..74df6fb 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -960,9 +960,9 @@ install-libraries: libraries @echo "Installing package msgcat 1.6.1 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl \ "$(MODULE_INSTALL_DIR)/8.5/msgcat-1.6.1.tm" - @echo "Installing package tcltest 2.5.3 as a Tcl Module" + @echo "Installing package tcltest 2.5.4 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \ - "$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.3.tm" + "$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.4.tm" @echo "Installing package platform 1.0.18 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl \ "$(MODULE_INSTALL_DIR)/8.4/platform-1.0.18.tm" diff --git a/win/Makefile.in b/win/Makefile.in index dbec774..71b40cd 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -740,8 +740,8 @@ install-libraries: libraries install-tzdata install-msgs done; @echo "Installing package msgcat 1.6.1 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl "$(MODULE_INSTALL_DIR)/8.5/msgcat-1.6.1.tm"; - @echo "Installing package tcltest 2.5.3 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl "$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.3.tm"; + @echo "Installing package tcltest 2.5.4 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl "$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.4.tm"; @echo "Installing package platform 1.0.18 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl "$(MODULE_INSTALL_DIR)/8.4/platform-1.0.18.tm"; @echo "Installing package platform::shell 1.1.4 as a Tcl Module"; -- cgit v0.12