quaint-telephone-89068
02/06/2023, 4:59 PMshell_command allows you to find binaries that are already on the system PATH (or other shell search paths if provided). This is fine for system/POSIX tools, but if it's a binary whose behaviour changes significantly with different versions, it would be useful to test that the binary's output matches a regexp.
Suggest the target would look like this:
system_binary(
binary_name="python3",
test_args=["--version"],
output_pattern=r"3\.([8-9]|([1-9][0-9]+))\.[0-9]+",
search_paths= # OPTIONAL_VALUE
)
Each python3 binary found would be run with --version, and tested for the output_pattern, the response would include the path to the binary, but also the specific value of the output_pattern for caching purposes.
pantsbuild/pantsuser
02/07/2023, 5:18 PMuser
02/22/2023, 4:47 PMuser
02/22/2023, 8:45 PM