Skip to content

tests: simplify pathhelp.pm, avoid using external tools - #15111

Closed
vszakats wants to merge 25 commits into
curl:masterfrom
vszakats:tests-pathhelp-tidy
Closed

tests: simplify pathhelp.pm, avoid using external tools#15111
vszakats wants to merge 25 commits into
curl:masterfrom
vszakats:tests-pathhelp-tidy

Conversation

@vszakats

@vszakats vszakats commented Oct 1, 2024

Copy link
Copy Markdown
Member

Instead of calling the shell and external tools, rely on Perl functions
like Cwd::getcwd(), Cwd::abs_path(), Cygwin::posix_to_win_path(),
Cygwin::win_to_posix_path() to retrieve the current directory and
convert between POSIX and Windows formats.

This adds native Windows Perl support, avoids most failure modes and
makes format guessing and other internal functions unnecessary.

Also:

  • delete unused sys_native_path().
  • delete redundant normalize_path() because Perl abs_path() already
    does it.

Cherry-picked from #14949

@vszakats vszakats changed the title tests: simplify pathhelp.pm, avoid using external tools tests: simplify pathhelp.pm, avoid using external tools Oct 1, 2024
@vszakats
vszakats force-pushed the tests-pathhelp-tidy branch from 2ed1416 to b757634 Compare October 1, 2024 17:42

@bagder bagder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that's a nice delta!!

@vszakats vszakats closed this in 0acf0bc Oct 2, 2024
@vszakats
vszakats deleted the tests-pathhelp-tidy branch October 2, 2024 13:05
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Instead of calling the shell and external tools, rely on Perl functions
like `Cwd::getcwd()`, `Cwd::abs_path()`, `Cygwin::posix_to_win_path()`,
`Cygwin::win_to_posix_path()` to retrieve the current directory and
convert between POSIX and Windows formats.

This adds native Windows Perl support, avoids most failure modes and
makes format guessing and other internal functions unnecessary.

Also:
- delete unused `sys_native_path()`.
- delete redundant `normalize_path()` because Perl `abs_path()` already
  does it.

Cherry-picked from curl#14949
Closes curl#15111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants