<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 16, 2018 at 2:41 AM James Henderson <<a href="mailto:jh7370.2008@my.bristol.ac.uk">jh7370.2008@my.bristol.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Thanks. The motivating example can be seen in this review: <a href="https://reviews.llvm.org/D44382" target="_blank">https://reviews.llvm.org/D44382</a>.<br><br></div>In that review, I am unit testing .debug_line parsing, specifically, the behaviour when the parser is fed a malformed section. Most of the code under test goes through some slight variations in the code path, depending on a) the DWARF version (interesting cases are 3, 4 and 5), and b) whether the DWARF is 32-bit DWARF or 64-bit DWARF. So I have two axes, with multiple values on each. The end "symptoms" being tested aren't much different in each case, so it makes sense to share the test code as much as possible. Without Combine, I have to do the following:<br><br>INSTANTIATE_TEST_CASE_P(<br>    LineTableTestParams, DebugLineParameterisedFixture,<br>    Values(std::make_pair(2, DWARF32), std::make_pair(3, DWARF32),<br>           std::make_pair(4, DWARF32), std::make_pair(5, DWARF32),<br>           std::make_pair(2, DWARF64), std::make_pair(3, DWARF64),<br>           std::make_pair(4, DWARF64), std::make_pair(5, DWARF64)));<br><br></div>I realised whilst typing this out, that I don't need a distinction between v2 and v3. However, there's still 6 different combinations, which I have to explicitly list. Combine would, by my understanding, allow me to do something like "Combine(Values(3, 4, 5), Values(DWARF32, DWARF64))".<br></div></div></blockquote><div><br>Is it especially valuable to test all 6? Or would sufficient coverage/confidence be achieved by testing, say, 3+32, 4+64, and 5+64? (ie: there's at least one test for each of the values, but not for each combination) - or is there interesting logic in the implementation that's different for each combination/pair?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div>As to why it doesn't work in 1.8, it's because LLVM has explicitly overridden the GTEST_HAS_TR1_TUPLE define (see utils\unittest\CMakeLists.txt and r316798). The short-story is that it's because recent MSVC compilers (sorry, I guess I was too broad in my original statement) have started issuing TR1 deprecation warnings, combined with C++11 not being detected properly.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 March 2018 at 18:31, Roman Lebedev <span dir="ltr"><<a href="mailto:lebedev.ri@gmail.com" target="_blank">lebedev.ri@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_1569355994712206833HOEnZb"><div class="m_1569355994712206833h5">On Thu, Mar 15, 2018 at 9:09 PM, David Blaikie via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> +Chandler who might have some thoughts on this.<br>
><br>
> Could you provide an example here of the motivation for the feature you're<br>
> missing? Might help motivate the discussion (and/or we'll end up nitpicking<br>
> how it could be done differently without that feature... - which is sort of<br>
> where I'm going with this. Combinatorial test case expansion does seem a bit<br>
> suspicious to me - I'd hope we could pick a few examples from the various<br>
> equivalence classes & that would suffice?)<br>
><br>
> On Mon, Mar 12, 2018 at 9:01 AM James Henderson via llvm-dev<br>
> <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> Hi all,<br>
>><br>
>> I'm currently writing some unit tests for some debug line error handling<br>
>> code I'm working on (see e.g. <a href="https://reviews.llvm.org/D44382" rel="noreferrer" target="_blank">https://reviews.llvm.org/D44382</a>), and I just<br>
>> ran into an annoying disabled feature in gtest, specifically the "Combine"<br>
>> feature for use in combinatorially generating parameterised tests. A FIXME<br>
>> comment in ProfileData\CoverageMappingTest.cpp suggests that I'm not the<br>
>> only one to have tried and discovered that they cannot use this feature. The<br>
>> problem is that the version of googletest (v 1.8.0, released in Aug 2016) in<br>
>> the LLVM tree requires TR1 tuple support for this feature, which is not<br>
>> really supported in recent compilers, and has been explicitly disabled in<br>
>> our googletest CMakeLists.txt, thus disabling "Combine".<br>
>><br>
>> I did a bit of looking around, and v 1.8.0 is indeed the last officially<br>
>> tagged release of googletest. However, there has been a lot of development<br>
>> on the framework since that point, including a fix to enable use of Combine<br>
>> with std::tuple-supporting compilers. There have been a number of issue<br>
>> raised on the googletest issue tracker (see e.g.<br>
>> <a href="https://github.com/google/googletest/issues/1467" rel="noreferrer" target="_blank">https://github.com/google/googletest/issues/1467</a> or<br>
>> <a href="https://github.com/google/googletest/issues/1079" rel="noreferrer" target="_blank">https://github.com/google/googletest/issues/1079</a>) asking about a 1.9.0<br>
>> release, and there has been zero response from anybody answering the query<br>
>> of when/if it will happen. In the meantime, the last release gets older and<br>
>> crustier...<br>
>><br>
>> I'd therefore like to propose something that might be seen as slightly<br>
>> controversial: update to use ToT googletest (or at least some reasonably<br>
>> recent version of master), at least until a new release is created.<br>
>><br>
>> Thoughts?<br>
</div></div>This sounds strange.<br>
<br>
I've been using googletest-1.8.0 in my project, with fresh compilers<br>
(clang, gcc - <a href="https://godbolt.org/g/jg4tFG" rel="noreferrer" target="_blank">https://godbolt.org/g/jg4tFG</a> - tr1/tuple works)<br>
and not once did i have any issues with unavailability of Combine,<br>
even though i do use it.<br>
<br>
Debian sid:<br>
$ dpkg -S tr1/tuple<br>
libstdc++-7-dev:amd64: /usr/include/c++/7/tr1/tuple<br>
libstdc++-5-dev:amd64: /usr/include/c++/5/tr1/tuple<br>
libstdc++-6-dev:amd64: /usr/include/c++/6/tr1/tuple<br>
<br>
So "which is not really supported in recent compilers" part is at<br>
least too broad.<br>
<span class="m_1569355994712206833HOEnZb"><font color="#888888"><br>
Roman.<br>
</font></span><div class="m_1569355994712206833HOEnZb"><div class="m_1569355994712206833h5"><br>
>> James<br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
><br>
</div></div></blockquote></div><br></div>
</blockquote></div></div>