Fix testing on msys when builddir is under /c mount point

Started by Noah Mischalmost 7 years ago2 messageshackers
Jump to latest
#1Noah Misch
noah@leadboat.com

Several TAP test suites have a need to translate from an msys path to a
Windows path. They currently use two ways to do that:

1. TestLib::real_dir, new in v11, is sound but works for directories only.
2. The $vfs_path approach is semi-private to PostgresNode.pm and 017_shm.pl,
and it does not work if the file falls in a mount point other than "/".
For example, it has been doing the wrong thing when builddir is
/c/nm/postgresql (falling in mount point /c).

I'd like to fix the mount point problem and consolidate these two methods. I
plan to call it TestLib::perl2host, since it translates a path in Perl's
notion of the filesystem to a path in the @host@ notion of the filesystem.
Attached.

Attachments:

msys2-mount-point-v1.patchtext/plain; charset=us-asciiDownload+25-32
#2Andrew Dunstan
andrew@dunslane.net
In reply to: Noah Misch (#1)
Re: Fix testing on msys when builddir is under /c mount point

On 6/10/19 12:58 AM, Noah Misch wrote:

Several TAP test suites have a need to translate from an msys path to a
Windows path. They currently use two ways to do that:

1. TestLib::real_dir, new in v11, is sound but works for directories only.
2. The $vfs_path approach is semi-private to PostgresNode.pm and 017_shm.pl,
and it does not work if the file falls in a mount point other than "/".
For example, it has been doing the wrong thing when builddir is
/c/nm/postgresql (falling in mount point /c).

I'd like to fix the mount point problem and consolidate these two methods. I
plan to call it TestLib::perl2host, since it translates a path in Perl's
notion of the filesystem to a path in the @host@ notion of the filesystem.
Attached.

Looks sane enough. I think I had to work round this recently by using a
Windows symlink/junction.

I haven't tested it.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services