Exporting symbols to access them from tests

2015-04-24 Thread Milian Wolff
Hey all, what's the best-practice to export symbols for tests only? In Qt, there is the Q_AUTOTEST_EXPORT macro: qglobal.h: /* No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols for Qt's internal unit tests. If you want slower loading times and more symbols

Re: Exporting symbols to access them from tests

2015-04-24 Thread Jeremy Whiting
Most of the frameworks I've seen do something like the following to explicitely link in the cpp files needed for the test. This taken from knewstuff/autotests/CMakeLists.txt macro(knewstuff_unit_tests) foreach(_testname ${ARGN}) add_executable(${_testname} ${_testname}.cpp

Re: Exporting symbols to access them from tests

2015-04-24 Thread Aleix Pol
On Fri, Apr 24, 2015 at 4:41 PM, Milian Wolff m...@milianw.de wrote: On Friday 24 April 2015 14:31:27 Aleix Pol wrote: On Fri, Apr 24, 2015 at 2:17 PM, Milian Wolff m...@milianw.de wrote: Hey all, what's the best-practice to export symbols for tests only? In Qt, there is the

Re: Exporting symbols to access them from tests

2015-04-24 Thread Milian Wolff
On Friday 24 April 2015 14:31:27 Aleix Pol wrote: On Fri, Apr 24, 2015 at 2:17 PM, Milian Wolff m...@milianw.de wrote: Hey all, what's the best-practice to export symbols for tests only? In Qt, there is the Q_AUTOTEST_EXPORT macro: qglobal.h: /* No, this is not an evil

Re: Exporting symbols to access them from tests

2015-04-24 Thread Thiago Macieira
On Friday 24 April 2015 16:41:32 Milian Wolff wrote: Or you want to conditionally define the Q_AUTOTEST_EXPORT depending on whether BUILD_TESTING (cmake variable) is on? This would add some differences into the libraries developersCI and users use (which isn't ideal) but should be fine