D43522 caused an assertion failure when getStyle() was called with
an empty filename:
P8065
This adds a test to reproduce the failure and fixes the issue by
ensuring we never pass an empty filename to
Environment::CreateVirtualEnvironment().
Test Plan: New test added. Ran test with:
% make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Before diff, test failed with P8065. Now, test passes.
Do you really want to try to find a ".clang-format" file here, with fallback to "Google" if no such file is found?
When I'm building I usually end up having my build directory inside the llvm repo. And since there is a .clang-format file checked in to llvm that file is found, as it searches for a .clang-format file somewhere in the directory structure above the current dir when running the test (if I remember correctly?). We have had such problem before.
Can't you just as well do
or is that not triggering the original bug?
Right now our build bots ends up like this (I guess it has found the .clang-format in my llvm/clang repo and decided to use "LLVM" as format for "Style1"):