From kde-buildsystem Wed Sep 19 23:21:46 2007 From: Alexander Neundorf Date: Wed, 19 Sep 2007 23:21:46 +0000 To: kde-buildsystem Subject: Re: EXECUTABLE_OUTPUT_PATH for tests Message-Id: <200709191921.46224.neundorf () kde ! org> X-MARC-Message: https://marc.info/?l=kde-buildsystem&m=119024405208802 On Wednesday 19 September 2007 18:55, Andreas Pakulat wrote: > On 19.09.07 18:40:16, Alexander Neundorf wrote: > > currently KDE4_ADD_TEST_EXECUTABLE and KDE4_ADD_UNIT_TEST set > > EXECUTABLE_OUTPUT_PATH back from bin/ to the current directory. > > > > I think this is a bad idea in general. > > In general maybe, but within kde I think its quite ok. Ok, so we disagree here. > > Imagine this cmake code: > > > > add_executable(foo main.cpp) > > add_executable(bar bar.c) > > Tests in kdelibs, kdepimlibs and other modules are in a separate > subdirectory with a separate CMakeLists.txt. Nearly all tests I > converted when adding these two macros were setting > EXECUTABLE_OUTPUT_PATH in that CMakeLists.txt. I think this is better, it makes obvious what is going on. This is about readability and long term maintainability. Reading SET(EXECUTABLE_OUTPUT_PATH wherever/) makes it very clear what happens, without requiring additional knowledge. It is just one simple line of code. This is somewhat similar to many of the changes in Qt4, where all-in-one-line ctors with many arguments were replaced by a simple ctor and multiple simple do-one-obvious-thing functions. What we have now is a hidden side effect by setting a (more or less) global variable in some seemingly unrelated function. > This is something that at least kdelibs developers want, putting the > tests into the current directory as that way you can easily check bin/ > to see which binaries are going to be installed. I don't see the significant value in this and it is only partly true. With the example above also foo and bar wouldn't appear in bin/, while they can have install rules. If it helps we could automatically put a "test_" prefix in front/at the end of all test executables to make this obvious. Alex _______________________________________________ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem