[cfe-dev] Tests for Clang-tidy STL containers checks

Csaba Raduly via cfe-dev cfe-dev at lists.llvm.org
Thu Dec 17 02:24:28 PST 2015


On Wed, Dec 16, 2015 at 7:38 PM, Eugene Zelenko via cfe-dev  wrote:
> Hi, Alexander!
>
> On Wed, Dec 16, 2015 at 5:53 AM, Alexander Kornienko  wrote:
>> We mock out STL containers for multiple reasons. One of them is to make the
>> tests hermetic (as in "independent from the environment"). The developer has
>> to make the mocks appropriately model the implementation of the standard
>> library. If another implementation is sufficiently different, we need to add
>> mocks for that implementation as well. Making the tests use actual library
>> headers is problematic, since it will significantly increase testing time
>> and complicate integration with different tests environments. So I'm
>> strongly against this. We could make a mode where the actual headers are
>> used instead of mock implementations, but we're not going to remove mocks
>> completely.
>
> Problem with hermetic tests that they are testing mocks, not real
> implementations.

Umm, no.

IIUC, these are tests for Clang-tidy, so they test the behavior of
Clang-tidy code.
STL containers are NOT under test; this is why they are mocked out.

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds



More information about the cfe-dev mailing list