Skip to content

[NFC][flang] Fix execute_command_line test for odd environments #117714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 27, 2024

Conversation

DavidTruby
Copy link
Member

One of the execute_command_line tests currently runs cat on an invalid file and checks its return value, but since we don't control cat or the user's path, the return value might not be reliably stable on a per-platform basis. For example, if git is installed on Windows in certain configurations it adds a directory to the path containing a cat with a different set of error codes to the default Windows one.

This patch changes the test to use the not binary built by LLVM for testing purposes, which should always return 1 on any platform regardless of the user's environment.

One of the execute_command_line tests currently runs `cat` on an invalid
file and checks its return value, but since we don't control `cat` or
the user's path, the return value might not be reliably stable on a
per-platform basis. For example, if `git` is installed on Windows in
certain configurations it adds a directory to the path containing a
`cat` with a different set of error codes to the default Windows one.

This patch changes the test to use the `not` binary built by LLVM for
testing purposes, which should always return 1 on any platform
regardless of the user's environment.
@llvmbot llvmbot added the flang Flang issues not falling into any other category label Nov 26, 2024
@DavidTruby
Copy link
Member Author

I guess my assumption that the tests are always run at the top of the build directory is incorrect. I'll have to work out how to get the path to the top level build dir.

The not binary will always be placed in this directory.
Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

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

LGTM

@DavidTruby DavidTruby merged commit e335563 into llvm:main Nov 27, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants