Is it possible to add a function to the test class called is ConfigurationSupported() that returns true or false but doesn't deal with Expected's, and if it returns true then we can expect the call later to succeed, at which point we can use the macro?<br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 29, 2017 at 4:57 AM George Rimar 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">grimar added inline comments.<br>
<br>
<br>
================<br>
Comment at: unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp:102<br>
   auto ExpectedDG = dwarfgen::Generator::create(Triple, Version);<br>
   if (HandleExpectedError(ExpectedDG))<br>
     return;<br>
----------------<br>
grimar wrote:<br>
> grimar wrote:<br>
> > zturner wrote:<br>
> > > I recently added some functions to llvm that server this purpose better.  I would suggest just deleting this function, and adding this:<br>
> > ><br>
> > > ```<br>
> > > #include "llvm/Testing/Support/Error.h"<br>
> > > ...<br>
> > > ASSERT_THAT_EXPECTED(ExpectedDG, Succeeded());<br>
> > > ```<br>
> > I'll take a look what ASSERT_THAT_EXPECTED do. If I got correctly from quivk look, that might be a better solution, really. Thanks !<br>
> After closer look I think ASSERT_THAT_EXPECTED will not work here.<br>
><br>
> ASSERT_THAT_EXPECTED fails the test if ExpectedDG not exist:<br>
><br>
> ```<br>
> error: Value of: llvm::detail::TakeExpected(ExpectedDG)<br>
> Expected: succeeded<br>
>   Actual: failed  (: error: unable to get target for 'i386-pc-windows-msvc', see<br>
>  --version and --triple.)<br>
> [  FAILED  ] DWARFDebugInfo.TestDWARF32Version2Addr4AllForms (115792 ms)<br>
> ```<br>
><br>
> But what code expected to do is to pass the test in this case.<br>
So to clarify: if ExpectedDG is exist, test should continue and run, if not - test should terminate with success result, that is how current code works.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D34744" rel="noreferrer" target="_blank">https://reviews.llvm.org/D34744</a><br>
<br>
<br>
<br>
</blockquote></div>