This is an archive of the discontinued LLVM Phabricator instance.

Fix lldb-dotest when dotest_args_str is empty
ClosedPublic

Authored by jingham on Aug 31 2022, 5:27 PM.

Details

Summary

When - after substitution - the dotest_args_str is empty, then we were still inserting the blank string into the args. Later on, a blank arg is taken to be a directory path and gets added to the CWD (which is generally in the build directory) and then none of the actual test directories match that, so we find no tests.

This patch fixes that by not adding blank arguments in lldb-dotest.

It could also be fixed by having the dotest implementation discard empty arguments, but I wasn't sure that was always correct, maybe you are somewhere in the test suite already and want to pass "" to dial up the current directory? So I went with fixing it where we were getting it wrong instead.

Diff Detail

Event Timeline

jingham created this revision.Aug 31 2022, 5:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2022, 5:27 PM
jingham requested review of this revision.Aug 31 2022, 5:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2022, 5:27 PM

Interesting, I would have expected array.extend([]) be a noop?

Or really, we split the string, resulting in an empty array, and apparently cmd.extend([]) adds an empty argument.

Interesting, I would have expected array.extend([]) be a noop?

Me too. Too bad the Python folks don't check with us more often...

Interesting, I would have expected array.extend([]) be a noop?

Me too. Too bad the Python folks don't check with us more often...

Ah, it's not that, rather:

string = ""
arr = string.split(";")
arr

['']

jingham updated this revision to Diff 457138.Aug 31 2022, 5:49 PM

This one actually works.

jingham added a comment.EditedAug 31 2022, 5:49 PM

Actually, I confused myself because I still had the other fix in place. This would still be an array with one empty element. You have to just not do the split if the string is empty and then it works sensibly.

aprantl accepted this revision.Aug 31 2022, 5:55 PM

Thanks, that makes more sense!

This revision is now accepted and ready to land.Aug 31 2022, 5:55 PM