[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Review Request 117800: Move tests inside libs/mediacenter and make them compile with the library
From:       Shantanu Tushar Jha <shantanu () kde ! org>
Date:       2014-04-28 16:19:15
Message-ID: CABQ4Km8U4e-hgB41C3xPDvP1D5Fd6UhjzDQ4uc1cjekqX2Pqrw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi folks,

This patch makes our tests compile with the actual sources files they are
testing, instead of linking to the object created from the sources. This is
done for these reasons-

* (this is the main reason) We no longer have to export classes just to
test them
* We can use ORM mapped classes such as Artist, Album without extra magic
for tests

However, this poses a problem that source files are built from scratch for
each test, thus considerably increasing build times. add_library with
STATIC or OBJECT don't help either because they are expecting the symbols
to be exported, just like SHARED.

Any suggestions how to solve this?


On Sun, Apr 27, 2014 at 9:38 PM, Shantanu Tushar <shantanu@kde.org> wrote:

> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117800/
> Review request for Plasma.
> By Shantanu Tushar.
> 
> *Updated April 27, 2014, 4:08 p.m.*
> Changes
> 
> Removed leftover CMakeLists.txt and removed unnecessary moc includes.
> 
> *Repository: * plasma-mediacenter
> Description
> 
> Doing so gives us two benefits-
> 1. We no longer have to export classes just to test them
> 2. We can use ORM mapped classes such as Artist, Album without extra magic for \
> tests 
> (the diff shows deleted/new files because of the move, reviewing CMakeLists.txt \
> changes should be sufficient) 
> Testing
> 
> compiles, all unit tests pass
> 
> Diffs (updated)
> 
> - libs/CMakeLists.txt (59334e9)
> - libs/mediacenter/CMakeLists.txt (37769f6)
> - libs/mediacenter/lastfmimagefetcher.h (4541c66)
> - libs/mediacenter/media.h (2d6cc73)
> - libs/mediacenter/pmcimagecache.h (d6d332e)
> - libs/mediacenter/subtitleprovider.h (6f0d0f6)
> - libs/test/CMakeLists.txt (52ec617)
> - libs/test/fakemediavalidator.h ()
> - libs/test/fakemediavalidator.cpp (c2fdc17)
> - libs/test/lastfmimagefetchertest.h ()
> - libs/test/lastfmimagefetchertest.cpp (9d06079)
> - libs/test/mediacentertest.h ()
> - libs/test/mediacentertest.cpp (bb4c4d1)
> - libs/test/medialibrarytest.h ()
> - libs/test/medialibrarytest.cpp (746d5b2)
> - libs/test/mediatest.h ()
> - libs/test/mediatest.cpp (86ec0d0)
> - libs/test/pmcmediatest.h ()
> - libs/test/pmcmediatest.cpp (4bdcae6)
> - libs/test/singletonfactorytest.h ()
> - libs/test/singletonfactorytest.cpp (b9fc987)
> - libs/test/testhelpers.h ()
> 
> View Diff <https://git.reviewboard.kde.org/r/117800/diff/>
> 



-- 
Shantanu Tushar    (UTC +0530)
http://www.shantanutushar.com


[Attachment #5 (text/html)]

<div dir="ltr"><div><div>Hi folks,<br><br></div>This patch makes our tests compile \
with the actual sources files they are testing, instead of linking to the object \
created from the sources. This is done for these reasons-<br> <br>* (this is the main \
reason) We no longer have to export classes just to test them<br>* We can use ORM \
mapped classes such as Artist, Album without extra magic for \
tests<br><br></div>However, this poses a problem that source files are built from \
scratch for each test, thus considerably increasing build times. add_library with \
STATIC or OBJECT don&#39;t help either because they are expecting the symbols to be \
exported, just like SHARED.<br> <br>Any suggestions how to solve \
this?<br><div><div><div><div><div class="gmail_extra"><br><br><div \
class="gmail_quote">On Sun, Apr 27, 2014 at 9:38 PM, Shantanu Tushar <span \
dir="ltr">&lt;<a href="mailto:shantanu@kde.org" \
target="_blank">shantanu@kde.org</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">



 <div>
  <div style="font-family:Verdana,Arial,Helvetica,Sans-Serif"><div class="">
   <table style="border:1px solid rgb(201,195,153)" bgcolor="#f9f3c9" cellpadding="8" \
width="100%">  <tbody><tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/117800/" \
target="_blank">https://git.reviewboard.kde.org/r/117800/</a>  </td>
    </tr>
   </tbody></table>
   <br>




</div><table style="background-image:url(&quot;https://git.reviewboard.kde.org/static/ \
rb/images/review_request_box_top_bg.ab6f3b1072c9.png&quot;);background-repeat:repeat-x;border:1px \
solid black" bgcolor="#fefadf" cellpadding="8" cellspacing="0" width="100%">

 <tbody><tr>
  <td><div class="">

<div>Review request for Plasma.</div>
<div>By Shantanu Tushar.</div>


</div><p style="color:grey"><i>Updated April 27, 2014, 4:08 p.m.</i></p>



<h1 style="color:rgb(87,80,18);font-size:10pt;margin-top:1.5em">Changes</h1>
<table style="border:1px solid rgb(184,181,160)" bgcolor="#ffffff" cellpadding="10" \
cellspacing="0" width="100%">  <tbody><tr>
  <td>
   <pre style="margin:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word">Removed \
leftover CMakeLists.txt and removed unnecessary moc includes.</pre>  </td>
 </tr>
</tbody></table><div class="">







<div style="margin-top:1.5em">
 <b style="color:rgb(87,80,18);font-size:10pt">Repository: </b>
plasma-mediacenter
</div>


<h1 style="color:rgb(87,80,18);font-size:10pt;margin-top:1.5em">Description </h1>
 <table style="border:1px solid rgb(184,181,160)" bgcolor="#ffffff" cellpadding="10" \
cellspacing="0" width="100%">  <tbody><tr>
  <td>
   <pre style="margin:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word">Doing \
so gives us two benefits- 1. We no longer have to export classes just to test them
2. We can use ORM mapped classes such as Artist, Album without extra magic for tests

(the diff shows deleted/new files because of the move, reviewing CMakeLists.txt \
changes should be sufficient)</pre>  </td>
 </tr>
</tbody></table>


<h1 style="color:rgb(87,80,18);font-size:10pt;margin-top:1.5em">Testing </h1>
<table style="border:1px solid rgb(184,181,160)" bgcolor="#ffffff" cellpadding="10" \
cellspacing="0" width="100%">  <tbody><tr>
  <td>
   <pre style="margin:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word">compiles, \
all unit tests pass</pre>  </td>
 </tr>
</tbody></table>


</div><h1 style="color:rgb(87,80,18);font-size:10pt;margin-top:1.5em">Diffs \
(updated)</h1> <ul style="margin-left:3em;padding-left:0px">

 <li>libs/CMakeLists.txt <span style="color:grey">(59334e9)</span></li>

 <li>libs/mediacenter/CMakeLists.txt <span style="color:grey">(37769f6)</span></li>

 <li>libs/mediacenter/lastfmimagefetcher.h <span \
style="color:grey">(4541c66)</span></li>

 <li>libs/mediacenter/media.h <span style="color:grey">(2d6cc73)</span></li>

 <li>libs/mediacenter/pmcimagecache.h <span style="color:grey">(d6d332e)</span></li>

 <li>libs/mediacenter/subtitleprovider.h <span \
style="color:grey">(6f0d0f6)</span></li>

 <li>libs/test/CMakeLists.txt <span style="color:grey">(52ec617)</span></li>

 <li>libs/test/fakemediavalidator.h <span style="color:grey">()</span></li>

 <li>libs/test/fakemediavalidator.cpp <span style="color:grey">(c2fdc17)</span></li>

 <li>libs/test/lastfmimagefetchertest.h <span style="color:grey">()</span></li>

 <li>libs/test/lastfmimagefetchertest.cpp <span \
style="color:grey">(9d06079)</span></li>

 <li>libs/test/mediacentertest.h <span style="color:grey">()</span></li>

 <li>libs/test/mediacentertest.cpp <span style="color:grey">(bb4c4d1)</span></li>

 <li>libs/test/medialibrarytest.h <span style="color:grey">()</span></li>

 <li>libs/test/medialibrarytest.cpp <span style="color:grey">(746d5b2)</span></li>

 <li>libs/test/mediatest.h <span style="color:grey">()</span></li>

 <li>libs/test/mediatest.cpp <span style="color:grey">(86ec0d0)</span></li>

 <li>libs/test/pmcmediatest.h <span style="color:grey">()</span></li>

 <li>libs/test/pmcmediatest.cpp <span style="color:grey">(4bdcae6)</span></li>

 <li>libs/test/singletonfactorytest.h <span style="color:grey">()</span></li>

 <li>libs/test/singletonfactorytest.cpp <span \
style="color:grey">(b9fc987)</span></li>

 <li>libs/test/testhelpers.h <span style="color:grey">()</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/117800/diff/" style="margin-left:3em" \
target="_blank">View Diff</a></p>







  </td>
 </tr>
</tbody></table>




  </div>
 </div>


</blockquote></div><br><br clear="all"><br>-- <br>Shantanu Tushar      (UTC \
+0530)<br><a href="http://www.shantanutushar.com" \
target="_blank">http://www.shantanutushar.com</a> \
</div></div></div></div></div></div>



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic