CMakeLists.txt 1.32 KB
Newer Older
1 2 3 4 5
SET(KIT QTCoreModules)
SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "DEBUG_LEAKS_ENABLE_EXIT_ERROR();" )
CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx
  qSlicerCamerasModuleTest1.cxx
  qSlicerCamerasModuleWidgetTest1.cxx
6 7
  qSlicerColorsModuleWidgetTest1.cxx
  qSlicerCoreModuleTest1.cxx
8
  qSlicerCoreModuleFactoryTest1.cxx
9
  qSlicerModulePanelTest2.cxx
10 11 12 13 14 15 16 17 18 19 20
  qSlicerTransformsModuleTest1.cxx
  qSlicerTransformsModuleWidgetTest1.cxx
  EXTRA_INCLUDE TestingMacros.h
  )

SET (TestsToRun ${Tests})
REMOVE (TestsToRun ${KIT}CxxTests.cxx)

SET(LIBRARY_NAME ${PROJECT_NAME})

ADD_EXECUTABLE(${KIT}CxxTests ${Tests})
21
TARGET_LINK_LIBRARIES(${KIT}CxxTests ${PROJECT_NAME})
22
SET_TARGET_PROPERTIES(${KIT}CxxTests PROPERTIES LABELS ${LIBRARY_NAME})
23

24 25 26
MACRO(SIMPLE_TEST TESTNAME)
  ADD_TEST(
    NAME ${TESTNAME} 
27
    COMMAND ${Slicer_LAUNCH_COMMAND} $<TARGET_FILE:${KIT}CxxTests> ${TESTNAME}
28
      ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SlicerQT
29
    )
30
  SET_PROPERTY(TEST ${TESTNAME} PROPERTY LABELS ${LIBRARY_NAME})
31
ENDMACRO()
32 33 34

SIMPLE_TEST( qSlicerCamerasModuleTest1 )
SIMPLE_TEST( qSlicerCamerasModuleWidgetTest1 )
35 36
SIMPLE_TEST( qSlicerColorsModuleWidgetTest1 )
SIMPLE_TEST( qSlicerCoreModuleTest1 )
37
SIMPLE_TEST( qSlicerCoreModuleFactoryTest1 )
38
SIMPLE_TEST( qSlicerModulePanelTest2 )
39 40
SIMPLE_TEST( qSlicerTransformsModuleTest1 )
SIMPLE_TEST( qSlicerTransformsModuleWidgetTest1 )
41