From kde-devel Mon Apr 28 16:19:15 2014 From: Shantanu Tushar Jha Date: Mon, 28 Apr 2014 16:19:15 +0000 To: kde-devel Subject: Re: Review Request 117800: Move tests inside libs/mediacenter and make them compile with the library Message-Id: X-MARC-Message: https://marc.info/?l=kde-devel&m=139870126031315 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============4676542125832569311==" --===============4676542125832569311== Content-Type: multipart/alternative; boundary=f46d0444eb0947ace104f81c8281 --f46d0444eb0947ace104f81c8281 Content-Type: text/plain; charset=UTF-8 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 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 > -- Shantanu Tushar (UTC +0530) http://www.shantanutushar.com --f46d0444eb0947ace104f81c8281 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi folks,

This patch makes our test= s compile with the actual sources files they are testing, instead of linkin= g 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 sour= ce files are built from scratch for each test, thus considerably increasing= build times. add_library with STATIC or OBJECT don't help either becau= se 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 include=
s.
Repository: plasma-mediacenter

Descripti= on

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 <= /h1>
compiles, all unit tests pass

Dif= fs (updated)

  • libs/CMakeLists.txt (59334e9)
  • libs/mediacenter/CMakeLists.txt (37769f6)
  • libs/mediacenter/lastfmimagefetcher.h (4541= c66)
  • libs/mediacenter/media.h (2d6cc73)
  • libs/mediacenter/pmcimagecache.h (d6d332e)<= /span>
  • libs/mediacenter/subtitleprovider.h (6f0d0f= 6)
  • libs/test/CMakeLists.txt (52ec617)
  • libs/test/fakemediavalidator.h ()
  • libs/test/fakemediavalidator.cpp (c2fdc17)<= /span>
  • libs/test/lastfmimagefetchertest.h ()
  • libs/test/lastfmimagefetchertest.cpp (9d060= 79)
  • 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 ()<= /li>
  • libs/test/singletonfactorytest.cpp (b9fc987= )
  • libs/test/testhelpers.h ()

View Diff




--
Shantanu Tushar=C2=A0 = =C2=A0 (UTC +0530)
http://www.shantanutushar.com
--f46d0444eb0947ace104f81c8281-- --===============4676542125832569311== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============4676542125832569311==--