<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Yes definitely, testing a small piece of code like the
GlobPattern::create() example, it would mostly indicate missing
unit tests or insufficient test data.<br>
<br>
In contrast to unit tests, however, it can also verify correct
handling of errors passed between function call hierarchies in
more complex scenarios.<br>
For this I should point to the other example in the code, where
it's applied to llvm::object::<span class="pl-c1">createBinary</span>():<br>
<a class="moz-txt-link-freetext" href="https://github.com/weliveindetail/ForceAllErrors-in-LLVM/blob/master/test/TestLLVMObject.h#L13">https://github.com/weliveindetail/ForceAllErrors-in-LLVM/blob/master/test/TestLLVMObject.h#L13</a><br>
<br>
Here it detects and runs 44 different control paths, that can
hardly be covered by a unit test altogether, because they don't
depend on the input to creatBinary() but rather on the environment
the test runs in.<br>
</p>
<div class="moz-cite-prefix">Am 27.07.17 um 16:46 schrieb David
Blaikie:<br>
</div>
<blockquote type="cite"
cite="mid:CAENS6Esv0Vmn4_z2XGzmTR-oaP2azcCW43=mHF6oFCnceO3pNQ@mail.gmail.com">
<div dir="ltr">I /kind/ of like the idea - but it almost feels
like this would be a tool for finding out that test coverage is
insufficient, then adding tests that actually exercise the bad
input, etc (this should be equally discoverable by code
coverage, probably? Maybe not if multiple error paths all
collapse together, maybe... )<br>
<br>
For instance, with your example, especially once there's an
identified bug that helps motivate, would it not be better to
add a test that does pass a fileName input that fails
GlobPattern::create?<br>
<br>
<div class="gmail_quote">
<div dir="ltr">On Thu, Jul 27, 2017 at 5:10 AM Stefan Gränitz
via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org"
moz-do-not-send="true">llvm-dev@lists.llvm.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,
this is a call for feedback: opinions, improvements,
testers..<br>
<br>
I use the support classes Expected<T> and
ErrorOr<T> quite often<br>
recently and I like the concept a lot! Thanks Lang btw!<br>
However, from time to time I found issues in the execution
paths of my<br>
error cases and got annoyed by their naturally low test
coverage.<br>
<br>
So I started sketching a test that runs all error paths for
a given<br>
piece of code to detect these issues. I just pushed it to
GitHub and<br>
added a little readme:<br>
<a
href="https://github.com/weliveindetail/ForceAllErrors-in-LLVM"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://github.com/weliveindetail/ForceAllErrors-in-LLVM</a><br>
<br>
Are there people on the list facing the same issue?<br>
How do you test your error paths?<br>
Could this be of use for you if it was in a reusable state?<br>
Is there something similar already around?<br>
Anyone seeing bugs or improvements?<br>
Could it maybe even increase coverage in the LLVM test suite
some day?<br>
<br>
Thanks for all kinds of feedback!<br>
Cheers, Stefan<br>
<br>
--<br>
<a href="https://weliveindetail.github.io/blog/"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://weliveindetail.github.io/blog/</a><br>
<a href="https://cryptup.org/pub/stefan.graenitz@gmail.com"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://cryptup.org/pub/stefan.graenitz@gmail.com</a><br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank"
moz-do-not-send="true">llvm-dev@lists.llvm.org</a><br>
<a
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="https://weliveindetail.github.io/blog/">https://weliveindetail.github.io/blog/</a>
<a class="moz-txt-link-freetext" href="https://cryptup.org/pub/stefan.graenitz@gmail.com">https://cryptup.org/pub/stefan.graenitz@gmail.com</a></pre>
</body>
</html>