<div dir="ltr">gtest seems like the best approach for testing internal implementation details IMO</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 25, 2017 at 10:51 PM Kuba (Brecka) Mracek via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">kubamracek added a comment.<br class="gmail_msg">
<br class="gmail_msg">
In <a href="https://reviews.llvm.org/D28502#657267" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D28502#657267</a>, @mpividori wrote:<br class="gmail_msg">
<br class="gmail_msg">
> @kubamracek  Thanks for your comments. Yes, I had to revert it because of the cmake code for the test. I need to review it.<br class="gmail_msg">
>  As this was a bug in the interception library, I think we should include it in the interception directory, instead of asan library.<br class="gmail_msg">
>  I discovered this bug when updating sanitizer coverage for windows. In <a href="https://reviews.llvm.org/D29168" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D29168</a>  , when asan dll is initialized, I analyse the exported symbols in the main executable. It was failing when the main executable doesn't export any symbol.  Then I realized there was a bug in the interception library.<br class="gmail_msg">
>  As I considered it a "regression test", and I read in the documentation: <a href="http://llvm.org/docs/TestingGuide.html" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/docs/TestingGuide.html</a>  that regression tests should go in the `repository/test` folder, I decided to include the test there.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
The "interception" library isn't provided to user code directly.  Either write a gtest-style unit test instead (in `lib/interception/tests`) or put the lit test into an existing sanitizer that is affected by the bug.  Adding a lit test suite that links against internals is just wrong.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Repository:<br class="gmail_msg">
  rL LLVM<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D28502" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D28502</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>