CMakeLists.txt 4.28 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
3
4
5

set(common_SRCS)
ecm_qt_declare_logging_category(common_SRCS HEADER createeventplugin_debug.h IDENTIFIER CREATEEVENTPLUGIN_LOG CATEGORY_NAME log_createeventplugin)
ecm_qt_declare_logging_category(common_SRCS HEADER createnoteplugin_debug.h IDENTIFIER CREATENOTEPLUGIN_LOG CATEGORY_NAME log_createnoteplugin)
ecm_qt_declare_logging_category(common_SRCS HEADER createtodoplugin_debug.h IDENTIFIER CREATETODOPLUGIN_LOG CATEGORY_NAME log_createtodoplugin)
Laurent Montel's avatar
Laurent Montel committed
6
7
ecm_qt_declare_logging_category(common_SRCS HEADER externalscriptplugin_debug.h IDENTIFIER EXTERNALSCRIPTPLUGIN_LOG CATEGORY_NAME log_externalscriptplugin)

Laurent Montel's avatar
Laurent Montel committed
8
9
10
11
macro(add_messageviewer_viewerplugin_unittest _source _additional _jsonfile)
    set( _test ${_source}  ${_additional} ${common_SRCS})
    get_filename_component(_name ${_source} NAME_WE)
    add_executable( ${_name} ${_test} )
Laurent Montel's avatar
Laurent Montel committed
12
13
14
    if (${_jsonfile})
       kcoreaddons_desktop_to_json(${_name} ${_jsonfile})
    endif()
Laurent Montel's avatar
Laurent Montel committed
15
16
17
    add_test( ${_name} ${_name} )

    ecm_mark_as_test(messageviewer-viewerplugin-unittest-${_name})
Laurent Montel's avatar
Laurent Montel committed
18
    target_link_libraries( ${_name} KF5::MessageViewer KF5::Libkleo KF5::QGpgme Qt5::Test Qt5::WebKitWidgets KF5::KIOCore KF5::Mime KF5::AkonadiCore KF5::AkonadiNotes KF5::CalendarCore KF5::GrantleeTheme KF5::IncidenceEditor)
Laurent Montel's avatar
Laurent Montel committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
endmacro ()



macro(add_messageviewer_viewerplugin_class_unittest _source )
    set( _test ${_source} ${common_SRCS})
    get_filename_component(_name ${_source} NAME_WE)
    add_executable( ${_name} ${_test} )
    add_test( ${_name} ${_name} )

    ecm_mark_as_test(messageviewer-viewerplugin-${_name})
    target_link_libraries( ${_name} KF5::MessageViewer KF5::Libkleo KF5::QGpgme Qt5::Test Qt5::WebKitWidgets KF5::KIOCore KF5::Mime KF5::AkonadiCore KF5::AkonadiNotes KF5::CalendarCore KF5::GrantleeTheme)
endmacro ()


macro(add_messageviewer_viewerplugin_widget_unittest _source _additional )
    set( _test ${_source} ${_additional} ${common_SRCS})
    get_filename_component(_name ${_source} NAME_WE)
    add_executable( ${_name} ${_test} )
    add_test( ${_name} ${_name} )

    ecm_mark_as_test(messageviewer-viewerplugin-${_name})
Laurent Montel's avatar
Laurent Montel committed
41
    target_link_libraries( ${_name} KF5::MessageViewer KF5::Libkleo KF5::QGpgme Qt5::Test Qt5::WebKitWidgets KF5::KIOCore KF5::Mime KF5::AkonadiCore KF5::AkonadiNotes KF5::CalendarCore KF5::GrantleeTheme KF5::IncidenceEditor)
Laurent Montel's avatar
Laurent Montel committed
42
43
44
45
46
47
48
49
50
51
52
endmacro ()


add_messageviewer_viewerplugin_class_unittest(viewerpluginmanagertest.cpp)
add_messageviewer_viewerplugin_class_unittest(viewerplugintoolmanagertest.cpp)
add_messageviewer_viewerplugin_widget_unittest(todoedittest.cpp "../createtodoplugin/todoedit.cpp")
add_messageviewer_viewerplugin_widget_unittest(noteedittest.cpp "../createnoteplugin/noteedit.cpp")
set_tests_properties(todoedittest PROPERTIES ENVIRONMENT "LC_ALL=C")

add_messageviewer_viewerplugin_widget_unittest(eventedittest.cpp "../createeventplugin/eventedit.cpp;../createeventplugin/eventdatetimewidget.cpp")
add_messageviewer_viewerplugin_widget_unittest(eventdatetimewidgettest.cpp "../createeventplugin/eventdatetimewidget.cpp")
Laurent Montel's avatar
Laurent Montel committed
53
54
55
add_messageviewer_viewerplugin_unittest(viewerplugincreateeventtest.cpp "../createeventplugin/eventdatetimewidget.cpp;../createeventplugin/eventedit.cpp;../createeventplugin/viewerplugincreateevent.cpp;../createeventplugin/viewerplugincreateeventinterface.cpp" "")
add_messageviewer_viewerplugin_unittest(viewerplugincreatetodotest.cpp "../createtodoplugin/viewerplugincreatetodo.cpp;../createtodoplugin/viewerplugincreatetodointerface.cpp;../createtodoplugin/todoedit.cpp" "")
add_messageviewer_viewerplugin_unittest(viewerplugincreatenotetest.cpp "../createnoteplugin/noteedit.cpp;../createnoteplugin/viewerplugincreatenote.cpp;../createnoteplugin/viewerplugincreatenoteinterface.cpp" "")
Laurent Montel's avatar
Laurent Montel committed
56
add_messageviewer_viewerplugin_unittest(viewerplugintranslatortest.cpp "../common/translatorplugin/viewerplugintranslator.cpp;../common/translatorplugin/viewerplugintranslatorinterface.cpp" "")
Laurent Montel's avatar
Laurent Montel committed
57
add_messageviewer_viewerplugin_unittest(viewerpluginexternalscripttest.cpp "../externalscriptplugin/viewerpluginexternalscript.cpp;../externalscriptplugin/viewerpluginexternalscriptinterface.cpp;../externalscriptplugin/viewerpluginexternalscriptmanager.cpp;../externalscriptplugin/viewerpluginexternalscriptinfo.cpp" "")
Laurent Montel's avatar
Laurent Montel committed
58
59

add_messageviewer_viewerplugin_unittest(viewerpluginexternalscriptinfotest.cpp "../externalscriptplugin/viewerpluginexternalscriptinfo.cpp" "")