This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Refine tests by adding `:` to checks
ClosedPublic

Authored by Fznamznon on Feb 22 2023, 6:48 AM.

Details

Summary

The tests can fail if working directory where the tests were launched
has a error substring in its path.

Diff Detail

Event Timeline

Fznamznon created this revision.Feb 22 2023, 6:48 AM
Herald added a project: Restricted Project. · View Herald Transcript
Fznamznon requested review of this revision.Feb 22 2023, 6:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2023, 6:48 AM
Fznamznon edited the summary of this revision. (Show Details)Feb 22 2023, 6:54 AM
Fznamznon added reviewers: foad, Joe_Nash, bcain, dsanders, grimar.
arsenm added a subscriber: arsenm.Feb 22 2023, 6:57 AM

Won't this just move the failure to cases with "error:" in the name? Can these change to read from stdin, or add a regex for the filename?

jhenderson accepted this revision.Feb 22 2023, 6:58 AM

LGTM, but best leave it a bit in case others have comments.

llvm/test/MC/Hexagon/multiple-pc4.s
1

Not related to your change, but does this line actually run FileCheck at all? I'm pretty sure it's missing a | character somewhere... Same goes with a few other tests you've modified.

(I am not familiar with these tests though, so my comment may be incorrect).

This revision is now accepted and ready to land.Feb 22 2023, 6:58 AM

Won't this just move the failure to cases with "error:" in the name?

It does, but there are many other tests that would run into that issue already. I suspect colons in file names are very rare...

Fznamznon added inline comments.Feb 22 2023, 7:39 AM
llvm/test/MC/Hexagon/multiple-pc4.s
1

I think it runs FileCheck. In this patch I modified only tests that were complaining about "error" substring in the path.
I think the magic is hidden in combination of "2>%t" in llvm-mc command and following "<%t" in FileCheck command.

jhenderson added inline comments.Feb 22 2023, 7:42 AM
llvm/test/MC/Hexagon/multiple-pc4.s
1

Ah, I compeltely misread that line, thanks! (The normal pattern is something like 2>&1 | FileCheck ... without the <%t at the end, so I read the 2>%t; bit as that!

I'm fine with the patch, but it's a shame the solution isn't more robust.
Its not self-evident why runline is written like that, so I expect uses without the ':' could creep back in.

LGTM, but best leave it a bit in case others have comments.

It's been a week, is it ok if I submit this?

I'm fine with the patch, but it's a shame the solution isn't more robust.

I'm open for any suggestions.

foad accepted this revision.Mar 1 2023, 3:33 AM

LGTM.

This revision was landed with ongoing or failed builds.Mar 3 2023, 2:24 AM
This revision was automatically updated to reflect the committed changes.