summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-09-13 12:16:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-09-13 12:16:56 (GMT)
commitdfa2b92acec26c1eff9f3e9476d6b0c4042064b9 (patch)
treefc1594d713fa4273a09515bce2576c9f3f65a53e /tests
parente5759a2dc4fcba761a5a25a858d434c8eee021d1 (diff)
downloadtcl-dfa2b92acec26c1eff9f3e9476d6b0c4042064b9.zip
tcl-dfa2b92acec26c1eff9f3e9476d6b0c4042064b9.tar.gz
tcl-dfa2b92acec26c1eff9f3e9476d6b0c4042064b9.tar.bz2
(Backport): Fix bug [fccb9f322f] - system encoding detection
Diffstat (limited to 'tests')
-rw-r--r--tests/unixInit.test17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/unixInit.test b/tests/unixInit.test
index 3bbe1e9..899779c 100644
--- a/tests/unixInit.test
+++ b/tests/unixInit.test
@@ -96,11 +96,26 @@ test unixInit-3.1 {TclpSetInitialEncodings} -constraints {
} -cleanup {
unset -nocomplain env(LANG)
} -match regexp -result {^(iso8859-15?|utf-8)$}
+
+# unixInit-3.2 depends on the *spawned* [interpreter] being able to locate
+# tcl_library without setting of TCL_LIBRARY env. This in turn depends on
+# Tcl's "library" directory being under the parent or grandparent of the
+# executable directory (the initScript search path in tclInterp.c).
+# Thus this constraint. On GiuHub CI, the only time this is not true
+# is for the XCode builds.
+if {[string match [zipfs root]* [info library]] ||
+ [file isfile [file normalize [file join [info nameofexecutable] .. .. library init.tcl]]] ||
+ [file isfile [file normalize [file join [info nameofexecutable] .. .. .. library init.tcl]]]
+} {
+ tcltest::testConstraint enableUnixInit32 1
+} else {
+ tcltest::testConstraint enableUnixInit32 0
+}
test unixInit-3.2 {TclpSetInitialEncodings} -setup {
catch {set oldlc_all $env(LC_ALL)}
catch {set oldtcl_library $env(TCL_LIBRARY)}
unset -nocomplain env(TCL_LIBRARY)
-} -constraints {unix stdio knownBug} -body {
+} -constraints {unix stdio enableUnixInit32} -body {
set env(LANG) japanese
set env(LC_ALL) japanese
set f [open "|[list [interpreter]]" w+]