<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 3 December 2013 11:57, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@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="im">On Tue, 3 Dec 2013 11:40:19 +0100<br>
Marek Ch <<a href="mailto:mchqwerty@gmail.com">mchqwerty@gmail.com</a>> wrote:<br>
<br>
> Also, the UNIT_TEST define (or it's renamed alternative) have to be<br>
> defined in both<br>
> src/Makefile.am and tests/Makefile.am. Wouldn't it be better to<br>
> handle this define<br>
> via <a href="http://configure.ac" target="_blank">configure.ac</a> in this case?<br>
<br>
</div>The approach used for matrix<br>
"borrows" the source files from sibling directories and compiles them<br>
separately for testing. See matrix_test_SOURCES.<br>
<br></blockquote><div>I have overlooked the borrowing, now it makes more sense and it's definitely<br></div><div>better solution :)<br></div><div><br></div><div>Thanks,<br></div><div>Marek Ch<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

UNIT_TEST is simply a switch, that alters the definition of the macro<br>
that is used to mark the directly testable private functions.<br>
<br>
If you think that this double compiling with different definitions is<br>
harmful, then that's another issue.<br>
<br>
<br>
Thanks,<br>
pq<br>
<div class="im HOEnZb"><br>
> On 2 December 2013 22:18, Bryce W. Harrington<br>
> <<a href="mailto:b.harrington@samsung.com">b.harrington@samsung.com</a>>wrote:<br>
><br>
> > On Fri, Nov 29, 2013 at 04:36:56PM +0200, Pekka Paalanen wrote:<br>
</div><div class="HOEnZb"><div class="h5">> > > Hi,<br>
> > ><br>
> > > instead of writing a C language parser to copy stuff around, how<br>
> > > about doing what was done with Weston matrix code? See:<br>
> > ><br>
> > > <a href="http://cgit.freedesktop.org/wayland/weston/tree/tests/Makefile.am" target="_blank">http://cgit.freedesktop.org/wayland/weston/tree/tests/Makefile.am</a><br>
> > > <a href="http://cgit.freedesktop.org/wayland/weston/tree/shared/matrix.c" target="_blank">http://cgit.freedesktop.org/wayland/weston/tree/shared/matrix.c</a><br>
> > > <a href="http://cgit.freedesktop.org/wayland/weston/tree/tests/matrix-test.c" target="_blank">http://cgit.freedesktop.org/wayland/weston/tree/tests/matrix-test.c</a><br>
> > ><br>
> > > and note UNIT_TEST and MATRIX_TEST_EXPORT that give the test code<br>
> > > access to otherwise static functions.<br>
> ><br>
> > I agree this looks like a better approach.  I wonder if the define<br>
> > could be named differently to more clearly indicate that the<br>
> > function is normally static?  So maybe like WL_STATIC_TESTABLE or<br>
> > some such?<br>
> ><br>
> > Bryce<br>
<br>
</div></div></blockquote></div><br></div></div>