Re: Best-practise currently for testing internal parts of libs? *_TEST_EXPORT macro?

2015-09-02 Thread David Faure
On Monday 31 August 2015 14:41:00 Friedrich W. H. Kossebau wrote: > > The only place lxr.kde.org pointed out to use the *TEST_EXPORT approach was > grantlee, which simply creates a separate file with the define that then is > appended to the file generated with generate_export_header: >

Re: Best-practise currently for testing internal parts of libs? *_TEST_EXPORT macro?

2015-09-02 Thread Friedrich W. H. Kossebau
Am Mittwoch, 2. September 2015, 11:20:19 schrieb David Faure: > On Monday 31 August 2015 14:41:00 Friedrich W. H. Kossebau wrote: > > The only place lxr.kde.org pointed out to use the *TEST_EXPORT approach > > was > > grantlee, which simply creates a separate file with the define that then > > is

Re: Best-practise currently for testing internal parts of libs? *_TEST_EXPORT macro?

2015-09-02 Thread Friedrich W. H. Kossebau
Am Montag, 31. August 2015, 09:26:52 schrieb Thiago Macieira: > On Monday 31 August 2015 14:41:00 Friedrich W. H. Kossebau wrote: > > #ifdef COMPILING_TESTS > > #if defined _WIN32 || defined _WIN64 > > Remove the Windows check. The next lines are valid outside of Windows too > and should be used

Re: Best-practise currently for testing internal parts of libs? *_TEST_EXPORT macro?

2015-09-02 Thread Friedrich W. H. Kossebau
Hi Kevin, Jeremy & David, thanks all for your replies so far, gives me/us a palette to chose from, nice :) Seems exporting symbols only for testing is not a great no-go with known big traps, okay. So no need to port away from that tomorrow. So... below: Am Montag, 31. August 2015, 18:54:19

Re: Best-practise currently for testing internal parts of libs? *_TEST_EXPORT macro?

2015-08-31 Thread Jeremy Whiting
The way the knewstuff tests work is by linking the source files being tested directly. For example the Entry test also links entry.cpp and entry.h directly. This way it doesn't need to have Entry private methods exported at all. This may or may not be the best way to do it though, but has worked

Re: Best-practise currently for testing internal parts of libs? *_TEST_EXPORT macro?

2015-08-31 Thread Thiago Macieira
On Monday 31 August 2015 14:41:00 Friedrich W. H. Kossebau wrote: > #ifdef COMPILING_TESTS > #if defined _WIN32 || defined _WIN64 Remove the Windows check. The next lines are valid outside of Windows too and should be used on all platforms. If and when I change Q_DECL_EXPORT to be protected

Re: Best-practise currently for testing internal parts of libs? *_TEST_EXPORT macro?

2015-08-31 Thread Kevin Funk
On Monday 31 August 2015 09:29:52 Jeremy Whiting wrote: > The way the knewstuff tests work is by linking the source files being > tested directly. For example the Entry test also links entry.cpp and > entry.h directly. This way it doesn't need to have Entry private > methods exported at all. This

Best-practise currently for testing internal parts of libs? *_TEST_EXPORT macro?

2015-08-31 Thread Friedrich W. H. Kossebau
Hi, what approach is best-practise currently for testing internal parts of libs? E.g. by symbols (classes) are not exported by default? In Calligra we have code that uses XYZ_TEST_EXPORT macros for those symbols which should be only exported in test-enabled builds, e.g. by defining