Tcl Source Code

Check-in [4337c99176]
Login

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

Overview
Comment:Discover localhost IPv4 and IPv6 addresses instad of hardcoding them This commit fixes a long-standing pain point of running tests in an environment where localhost isn't bound to 127.0.0.1 or ::1, e.g., in a FreeBSD jail. It does that by introducing two variables, ::tcltest_ipv4 and ::tcltest_ipv6, which can be used by tests to refer to the local IPv4 and IPv6 addresses, respectively. The variables are populated in fallback order from a server socket, from environment variables, and from the hard-coded defaults.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | gahr-no-hardcoded-ip-addresses
Files: files | file ages | folders
SHA3-256: 4337c99176a2744929aaf3ce3cb52f826b5d1c28288d29c88decef1138425cf3
User & Date: gahr 2026-09-15 20:01:47.569
Original Comment: Discover localhost IPv4 and IPv6 addresses instad of hardcoding them This commit fixes a long-standing pain point of running tests in an environment where localhost isn't bound to 127.0.0.1 or ::1, e.g., in a FreeBSD jail. It does that by introducing two variables, ::tcltest_ipv4 and ::tcltest_ipv6, which can be used by tests to refer to the local IPv4 and IPvt6 addresses, respectively. The variables are populated in fallback order from a server socket, from environment variables, and from the hard-coded defaults.
Context
2026-09-15
21:50
Provide the functionality in tcltest itself check-in: 5cf8ba82d6 user: gahr tags: gahr-no-hardcoded-ip-addresses
20:01
Discover localhost IPv4 and IPv6 addresses instad of hardcoding them This commit fixes a long-sta... check-in: 4337c99176 user: gahr tags: gahr-no-hardcoded-ip-addresses
19:58
Merge trunk check-in: aa9600a3c5 user: gahr tags: gahr-no-hardcoded-ip-addresses
Changes
Unified Diff Side-by-Side Diff Patch
Changes to tests/all.tcl.
Changes to tests/chan.test.
Changes to tests/chanio.test.
Changes to tests/event.test.
Changes to tests/httpProxy.test.
Changes to tests/io.test.
Changes to tests/ioCmd.test.
Changes to tests/iogt.test.
Changes to tests/socket.test.
Changes to tests/unixInit.test.