From ed74769bfaae171809c0bc1a10a8ba0f6ff8895f Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Wed, 21 Dec 2016 01:09:27 +0300 Subject: tdeio: add tests Signed-off-by: Alexander Golubev --- tdeio/tdefile/CMakeLists.txt | 2 ++ tdeio/tdefile/tests/CMakeLists.txt | 40 +++++++++++++++++++++++++++ tdeio/tdefile/tests/kcustommenueditortest.cpp | 2 +- tdeio/tdefile/tests/kdirselectdialogtest.cpp | 2 +- tdeio/tdefile/tests/kfstest.cpp | 2 +- tdeio/tdefile/tests/kicondialogtest.cpp | 2 +- tdeio/tdefile/tests/knotifytest.cpp | 10 ------- tdeio/tdefile/tests/kopenwithtest.cpp | 2 +- tdeio/tdefile/tests/kurlrequestertest.cpp | 2 +- tdeio/tdefile/tests/tdefilenotifytest.cpp | 10 +++++++ tdeio/tdefile/tests/tdefiletreeviewtest.cpp | 2 +- 11 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 tdeio/tdefile/tests/CMakeLists.txt delete mode 100644 tdeio/tdefile/tests/knotifytest.cpp create mode 100644 tdeio/tdefile/tests/tdefilenotifytest.cpp (limited to 'tdeio/tdefile') diff --git a/tdeio/tdefile/CMakeLists.txt b/tdeio/tdefile/CMakeLists.txt index ed0350999..8952005ed 100644 --- a/tdeio/tdefile/CMakeLists.txt +++ b/tdeio/tdefile/CMakeLists.txt @@ -9,6 +9,8 @@ # ################################################# +add_subdirectory( tests ) + include_directories( ${TQT_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} diff --git a/tdeio/tdefile/tests/CMakeLists.txt b/tdeio/tdefile/tests/CMakeLists.txt new file mode 100644 index 000000000..4c8c0dcce --- /dev/null +++ b/tdeio/tdefile/tests/CMakeLists.txt @@ -0,0 +1,40 @@ +################################################# +# +# (C) 2016 Alexander Golubev +# fatzer2 (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_BINARY_DIR}/tdeio/tdefile +) + +link_directories( + ${TDECORE_LIBRARY_DIRS} +) + +tde_add_check_executable( kurlrequestertest LINK tdeio-shared ) +tde_add_check_executable( kopenwithtest LINK tdeio-shared ) +tde_add_check_executable( kdirselectdialogtest LINK tdeio-shared ) +tde_add_check_executable( kicondialogtest LINK tdeio-shared ) +tde_add_check_executable( kcustommenueditortest LINK tdeio-shared ) +tde_add_check_executable( tdefilenotifytest LINK tdeio-shared ) + +tde_add_check_executable( tdefiletreeviewtest AUTOMOC LINK tdeio-shared ) + +tde_add_check_executable( kfstest AUTOMOC + SOURCES kfstest.cpp kfdtest.cpp LINK tdeio-shared ) diff --git a/tdeio/tdefile/tests/kcustommenueditortest.cpp b/tdeio/tdefile/tests/kcustommenueditortest.cpp index 9e2189406..97e906fbe 100644 --- a/tdeio/tdefile/tests/kcustommenueditortest.cpp +++ b/tdeio/tdefile/tests/kcustommenueditortest.cpp @@ -6,7 +6,7 @@ int main(int argc, char** argv) { TDELocale::setMainCatalogue("tdelibs"); - TDEApplication app(argc, argv, "KCustomMenuEditorTest"); + TDEApplication app(argc, argv, "KCustomMenuEditorTest", true); KCustomMenuEditor editor(0); TDEConfig *cfg = new TDEConfig("kdesktop_custom_menu2"); editor.load(cfg); diff --git a/tdeio/tdefile/tests/kdirselectdialogtest.cpp b/tdeio/tdefile/tests/kdirselectdialogtest.cpp index c1178c3bc..71adee9a8 100644 --- a/tdeio/tdefile/tests/kdirselectdialogtest.cpp +++ b/tdeio/tdefile/tests/kdirselectdialogtest.cpp @@ -5,7 +5,7 @@ int main( int argc, char **argv ) { - TDEApplication app(argc, argv, "kdirselectdialogtest"); + TDEApplication app(argc, argv, "kdirselectdialogtest", true); KURL u = KDirSelectDialog::selectDirectory( (argc >= 1) ? argv[1] : TQString::null ); if ( u.isValid() ) diff --git a/tdeio/tdefile/tests/kfstest.cpp b/tdeio/tdefile/tests/kfstest.cpp index ada8d825e..021fdb3a3 100644 --- a/tdeio/tdefile/tests/kfstest.cpp +++ b/tdeio/tdefile/tests/kfstest.cpp @@ -44,7 +44,7 @@ int main(int argc, char **argv) { - TDEApplication a(argc, argv, "kfstest"); + TDEApplication a(argc, argv, "kfstest", true); TQString name1; TQStringList names; diff --git a/tdeio/tdefile/tests/kicondialogtest.cpp b/tdeio/tdefile/tests/kicondialogtest.cpp index 3000e89a0..b516ee07d 100644 --- a/tdeio/tdefile/tests/kicondialogtest.cpp +++ b/tdeio/tdefile/tests/kicondialogtest.cpp @@ -3,7 +3,7 @@ int main( int argc, char **argv ) { - TDEApplication app( argc, argv, "kicondialogtest" ); + TDEApplication app( argc, argv, "kicondialogtest", true ); // TDEIconDialog::getIcon(); diff --git a/tdeio/tdefile/tests/knotifytest.cpp b/tdeio/tdefile/tests/knotifytest.cpp deleted file mode 100644 index 1716a86a3..000000000 --- a/tdeio/tdefile/tests/knotifytest.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -int main( int argc, char **argv ) -{ - TDEApplication app( argc, argv, "knotifytest" ); - KNotifyDialog *dlg = new KNotifyDialog(); - dlg->addApplicationEvents( "twin" ); - return dlg->exec(); -} diff --git a/tdeio/tdefile/tests/kopenwithtest.cpp b/tdeio/tdefile/tests/kopenwithtest.cpp index 925aa7625..fe7ae3986 100644 --- a/tdeio/tdefile/tests/kopenwithtest.cpp +++ b/tdeio/tdefile/tests/kopenwithtest.cpp @@ -28,7 +28,7 @@ int main(int argc, char **argv) { - TDEApplication app(argc, argv, "kopenwithtest"); + TDEApplication app(argc, argv, "kopenwithtest", true); KURL::List list; list += KURL("file:///tmp/testfile.txt"); diff --git a/tdeio/tdefile/tests/kurlrequestertest.cpp b/tdeio/tdefile/tests/kurlrequestertest.cpp index 829055304..023603082 100644 --- a/tdeio/tdefile/tests/kurlrequestertest.cpp +++ b/tdeio/tdefile/tests/kurlrequestertest.cpp @@ -5,7 +5,7 @@ int main( int argc, char **argv ) { - TDEApplication app( argc, argv, "kurlrequestertest" ); + TDEApplication app( argc, argv, "kurlrequestertest", true ); KURL url = KURLRequesterDlg::getURL( "ftp://ftp.kde.org" ); tqDebug( "Selected url: %s", url.url().latin1()); diff --git a/tdeio/tdefile/tests/tdefilenotifytest.cpp b/tdeio/tdefile/tests/tdefilenotifytest.cpp new file mode 100644 index 000000000..10dd5959d --- /dev/null +++ b/tdeio/tdefile/tests/tdefilenotifytest.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main( int argc, char **argv ) +{ + TDEApplication app( argc, argv, "knotifytest", true ); + KNotifyDialog *dlg = new KNotifyDialog(); + dlg->addApplicationEvents( "twin" ); + return dlg->exec(); +} diff --git a/tdeio/tdefile/tests/tdefiletreeviewtest.cpp b/tdeio/tdefile/tests/tdefiletreeviewtest.cpp index 9ff0199dc..da031eac2 100644 --- a/tdeio/tdefile/tests/tdefiletreeviewtest.cpp +++ b/tdeio/tdefile/tests/tdefiletreeviewtest.cpp @@ -134,7 +134,7 @@ void testFrame::slotSetChildCount( KFileTreeViewItem *item, int c ) int main(int argc, char **argv) { - TDEApplication a(argc, argv, "tdefiletreeviewtest"); + TDEApplication a(argc, argv, "tdefiletreeviewtest", true); TQString name1; TQStringList names; -- cgit v1.2.1