Thomas,
Thank you for your fast and explicit answer. Here's what I did:
1) I created a Git repository for our testing data
2) I created a CMakeExternals/MyData.cmake which fetch the data directly
from the Git repository and place it in
PathToBinary/CMakeExternals/Source/MyData
3) I modified the application CMakeLists.txt to include MyData.cmake when
tests are enabled. I also taken care of setting paths (EP_BASE, etc)
correctly. I placed the code there because by default,
CMakeExternals/*.cmake files are only processed by the Superbuild and I
don't use it for my personal development
...
if(BUILD_TESTING)
...
set(ep_base "${CMAKE_BINARY_DIR}/CMakeExternals")
set(ep_source_dir "${ep_base}/Source")
set_property(DIRECTORY PROPERTY EP_BASE ${ep_base})
include(CMakeExternals/MyData.cmake)
...
endif()
4) I used mitkAddCustomModuleTest in my
Modules/MyModule/Testing/CMakeLists.txt
5) I added my cpp file to the MODULE_CUSTOM_TESTS variable in the
files.cmake
The link to the file is passed to the application as a command line
argument (in argv).
This solution works for us on both development and build machines.
Thanks,
On Thu, Nov 15, 2012 at 11:58 AM, Kilgus, Thomas <
[email protected]> wrote:
> Hi Félix,****
>
> ** **
>
> right now I’m not sure how external users are supposed to add test data in
> their own application. I think the “Data” directory in the “Testing” folder
> including mitkStandardFileLocations is rather deprecated. I can just tell
> you how we currently add test data to MITK, but I think this should also do
> the job for you (at least on your local build). I guess you want to run a
> dartclient which runs your test every night? ****
>
> ** **
>
> This is how we add test data:****
>
> **- **We have an extra git repository for data. It is located
> in: “PathToYourBinary/CMakeExternals/Source/MITK-Data/”****
>
> **- **Example tests which make use of this data can be found in:
> Source/Core/Code/Testing/****
>
> **- **You have to add custom tests to cmake in the
> CMakeLists.txt via “mitkAddCustomModuleTest” (e.g.
> Source/Core/Code/Testing/CMakeLists.txt) and pass the path to the data via
> the command line argument.****
>
> **- **There we use the ${MITK_DATA_DIR} variable to specify the
> path to the data. I know that there also other variables which point to
> other directories (e.g. your module or the binary directory).****
>
> **- ** We have a new helper class mitkIOUtil which allows you to
> load your data with just one line of code.****
>
> ** **
>
> If it is not an option for you to add local data to the ${MITK_DATA_DIR},
> let us know. I’m sure there is another solution for external data. ****
>
> ** **
>
> Regards****
>
> Thomas****
>
> ** **
>
> *From:* Félix C. Morency [mailto:[email protected]]
> *Sent:* Donnerstag, 15. November 2012 17:37
> *To:* [email protected]
> *Subject:* [mitk-users] Add files to tests in custom application****
>
> ** **
>
> Hi list,****
>
> ** **
>
> I wrote a custom module that I placed in the Modules directory of my
> custom application. I wrote a test for my module that I placed in
> MyApp/Modules/MyModule/Testing. I added some custom data (xml file) in the
> MyApp/Modules/MyModule/Testing/Data directory for the test to read. I tried
> to use mitkStandardFileLocations to get the path to my data from my test
> but it doesn't work. None of the path added to the search list is relative
> to my project root directory. Is there a mechanism already built-in to add
> custom data to tests that are located in a custom MITK-based application?*
> ***
>
> ** **
>
> Regards,****
>
> --
> Félix C. Morency, M.Sc.
> Plateforme d’analyse et de visualisation d’images
> Centre Hospitalier Universitaire de Sherbrooke
> Centre de recherche clinique Étienne-Le Bel
> Local Z5-3031 | 819.346.1110 ext 16634 ****
>
--
--
Félix C. Morency, M.Sc.
Plateforme d’analyse et de visualisation d’images
Centre Hospitalier Universitaire de Sherbrooke
Centre de recherche clinique Étienne-Le Bel
Local Z5-3031 | 819.346.1110 ext 16634
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users