Skip to content
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

Proper way to test shipped binaries #50

Open
renefritze opened this issue Sep 22, 2022 · 1 comment
Open

Proper way to test shipped binaries #50

renefritze opened this issue Sep 22, 2022 · 1 comment

Comments

@renefritze
Copy link

Over on the https://github.com/ssciwr/clang-tidy-wheel I've run into trouble testing the binary that's shipped with the wheel.
The get_executable stuff in the package does not append .exe on windows. If we use subprocess.run on the resulting absolute path that fails. If you use subprocess.run just on the command name and rely on it being in PATH, windows will silently add .exe. I've found this out because in the test I use something like

exe = clang_tidy._get_executable("clang-tidy")
subprocess.run([exe])

Note that in the format tests here, the command name form is used. In fact the clang_format package is never imported.
This might execute the right binary, but depends on ordering in PATH. clang-format is also installed in the windows base image.

I suspect the situation on MacOS might be similar if the build results in a clang-tidy.{bin,dmg}, but haven't checked yet.

I think using the full absolute path in the tests is the correct way to do it. And once I got it all fixed on the tidy side, I would PR a matching update here.

@nightlark
Copy link
Contributor

The resulting binaries that actually get run on macOS don't have an extension. (.dmg is a disk image and sort of acts like a zip/tar archive for distributing apps; .app is just a folder whose contents have a special structure; .pkg is an installer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants