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

Fix tests with spaces in their names not executing when ran from the testing ui #237

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

apache-hb
Copy link
Contributor

Previously running a test which contained a space in its name, ie command line parsing would result in the test runner printing

ERROR: *:command test name does not match any test

This encloses the test name in quotes so its parsed correctly on the command line.

@tristan957
Copy link
Contributor

Can you use a real commit message? Can you confirm that this actually works. Upon first inspection, I don't really see why this would work.

This prevents the test harness from failing when test names contain
spaces due to `exec` parsing spaces as multiple arguments.
@apache-hb
Copy link
Contributor Author

Can you use a real commit message?

Fixed

Can you confirm that this actually works.

I tested it by running tests from the vscode test provider and having them pass rather than error out with the error message mentioned above.
image

Upon first inspection, I don't really see why this would work.

This works because child_process.execFile - at least on windows - concatenates all arguments together naïvely before handing them off to CreateProcess. Adding the quotes makes meson/python parse the test name as a single argument rather than multiple.

@tristan957
Copy link
Contributor

Do we have the same problem if buildDir has a space in it?

@tristan957 tristan957 added this pull request to the merge queue Jul 1, 2024
Merged via the queue into mesonbuild:main with commit 7065db4 Jul 1, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants