This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] [NFC] Do not use hardcoded relative paths in tests.
ClosedPublic

Authored by george.karpenkov on May 23 2018, 3:02 PM.

Diff Detail

Event Timeline

morehouse added inline comments.May 23 2018, 7:25 PM
test/fuzzer/minimize_crash.test
9

Is there a way to do a partial match on the file names or use %t.dir in the regex?

The main difference between lines 6 and 8 is whether we specify the artifact path or not. But your change makes lines 7 and 9 the same.

test/fuzzer/minimize_crash.test
9

Good point. %t.dir can not be used in the regex directly (as it is picked up by FileCheck as it is), but tricks can be used. TBH that further interferes with our magic for rewriting paths to run on a device.

What I would really like to do is to say "match whatever until you can match not_minimal_crash". I.e. in Python regex had a mode for "lazy" matching which would have been suitable here.
Any ideas how to do this in FileCheck? Conceptually, non-nested lazy matching does not require backtracking and can still be done with a DFA, and the need for it turns up often enough, so I'm quite confused as to why there's no reasonable way to match that.

morehouse added inline comments.May 24 2018, 3:22 PM
test/fuzzer/minimize_crash.test
9

I'm not sure I understand what you mean. But wouldn't these work?

failed to minimize beyond {{.*}}/minimized-from-{{.*}} (3 bytes)
failed to minimize beyond {{.*}}.exact_minimized_path

test/fuzzer/minimize_crash.test
9

But wouldn't these work?

In my understanding, regular expression matching is eager, and the match on .* will consume the entire string, so minimized-from would have nothing to match on.

test/fuzzer/minimize_crash.test
9

@morehouse actually NVM, I was confused by a different regexp implementation. Thanks for your note, I'll change it!

George, how do you create such stack of patches? Is there any automated tool for that?

George, how do you create such stack of patches? Is there any automated tool for that?

Nope, I just manually commit on a branch, copy the hash git emits to the clipboard, pipe the diff through pbcopy, and then manually create the revision :(
I haven't even started using arc

george.karpenkov marked an inline comment as done.
vitalybuka accepted this revision.May 25 2018, 1:10 PM
This revision is now accepted and ready to land.May 25 2018, 1:10 PM
morehouse accepted this revision.Jun 4 2018, 11:13 AM
This revision was automatically updated to reflect the committed changes.
Herald added subscribers: Restricted Project, llvm-commits. · View Herald TranscriptJun 12 2018, 2:18 PM