This is an archive of the discontinued LLVM Phabricator instance.

[clang-scan-deps] Fix tests - prevent FileCheck matching temp dir path
ClosedPublic

Authored by jkorous on Sep 9 2019, 4:15 PM.

Details

Summary

CHECKs are always passing as FileCheck is actually matching part of test directory path instead of test output.

For example:

// CHECK-NEXT: header_stat_before_open.m

would pass with

/tmp/build/tools/clang/test/ClangScanDeps/Output/header_stat_before_open.m.tmp.dir/WHATEVER_FOO

Shoutout to @JDevlieghere who solved the puzzle why a CHECK is insensitive to test output!

I just added suffix "_input" to all test inputs to keep it simple and consistent. Happy to go with a different convention - open to suggestions as usually.

Honestly, I think it's very easy to shoot ourselves in the foot this way :( It might be worth writing a script that verifies that CHECKs don't contain test filename and run it in CI.

Diff Detail

Repository
rL LLVM

Event Timeline

jkorous created this revision.Sep 9 2019, 4:15 PM
arphaman accepted this revision.Sep 9 2019, 5:51 PM

Good catch, thanks!

This revision is now accepted and ready to land.Sep 9 2019, 5:51 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 10 2019, 5:29 PM