Medical Imaging Interaction Toolkit  2018.4.99-6aa36ba9
Medical Imaging Interaction Toolkit
mitkFunctionTestPlugin.cmake
Go to the documentation of this file.
1 
2 # Call this macro after calling mitk_create_plugin for a test plugin
3 # in your CMakeLists.txt
4 #
5 # Variables:
6 #
7 # - BLUEBERRY_TEST_APP contains the name of the executable which will start the OSGi framework
8 #
10 
11  set(_cla_switch "--")
12  if(WIN32)
13  if(MSYS)
14  set(_cla_switch "//")
15  else()
16  set(_cla_switch "/")
17  endif()
18  endif()
19 
20  if(NOT BUNDLE-SYMBOLICNAME)
21  string(REPLACE "_" "." BUNDLE-SYMBOLICNAME ${PROJECT_NAME})
22  endif()
23  add_test(${BUNDLE-SYMBOLICNAME} ${BLUEBERRY_TEST_APP} ${_cla_switch}BlueBerry.application=coretestapplication ${_cla_switch}BlueBerry.testplugin=${BUNDLE-SYMBOLICNAME})
24 
25  set(_labels ${ARGN})
26  if(NOT _labels)
27  set(_labels BlueBerry)
28  endif()
29  set_property(TEST ${BUNDLE-SYMBOLICNAME} PROPERTY LABELS ${_labels})
30 
31 endfunction()
32 
33 # Variables:
34 #
35 # - BLUEBERRY_UI_TEST_APP contains the name of the executable which will start the OSGi framework
36 # - BLUEBERRY_TEST_APP_ID contains the application id of the application to test. If empty,
37 # a minimalistic default application will be started
39 
40  set(_cla_switch "--")
41  if(WIN32)
42  if(MSYS)
43  set(_cla_switch "//")
44  else()
45  set(_cla_switch "/")
46  endif()
47  endif()
48 
49  if(NOT BUNDLE-SYMBOLICNAME)
50  string(REPLACE "_" "." BUNDLE-SYMBOLICNAME ${PROJECT_NAME})
51  endif()
52 
53  if(BLUEBERRY_ENABLE_GUI_TESTING)
54  if(BLUEBERRY_TEST_APP_ID)
55  set(_app_id_arg "${_cla_switch}BlueBerry.testapplication=${BLUEBERRY_TEST_APP_ID}")
56  else()
57  set(_app_id_arg )
58  endif()
59 
60  add_test(${BUNDLE-SYMBOLICNAME} ${BLUEBERRY_UI_TEST_APP} ${_cla_switch}BlueBerry.application=uitestapplication ${_app_id_arg} ${_cla_switch}BlueBerry.testplugin=${BUNDLE-SYMBOLICNAME})
61 
62  set(_labels ${ARGN})
63  if(NOT _labels)
64  set(_labels BlueBerry)
65  endif()
66  set_property(TEST ${BUNDLE-SYMBOLICNAME} PROPERTY LABELS ${_labels})
67  endif()
68 
69 endmacro(MACRO_TEST_UIPLUGIN)
MACRO_TEST_UIPLUGIN()
mitkFunctionTestPlugin()