diff --git a/CMakeLists.txt b/CMakeLists.txt index e880492..6b070c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KITEMMODELS add_subdirectory(src) if (BUILD_TESTING) add_subdirectory(autotests) + add_subdirectory(tests) endif() diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index 9a838d4..731b83b 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -32,4 +32,3 @@ ecm_add_test(kselectionproxymodel_smoketest.cpp ${proxyModelSmokeTestSources} LINK_LIBRARIES KF5::ItemModels Qt5::Test Qt5::Widgets proxymodeltestsuite ) -add_subdirectory(proxymodeltestapp) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..8485e4b --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,4 @@ +remove_definitions(-DQT_NO_CAST_TO_ASCII) +remove_definitions(-DQT_NO_CAST_FROM_ASCII) + +add_subdirectory(proxymodeltestapp) diff --git a/autotests/proxymodeltestapp/CMakeLists.txt b/tests/proxymodeltestapp/CMakeLists.txt similarity index 100% rename from autotests/proxymodeltestapp/CMakeLists.txt rename to tests/proxymodeltestapp/CMakeLists.txt diff --git a/autotests/proxymodeltestapp/breadcrumbdirectionwidget.cpp b/tests/proxymodeltestapp/breadcrumbdirectionwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/breadcrumbdirectionwidget.cpp rename to tests/proxymodeltestapp/breadcrumbdirectionwidget.cpp diff --git a/autotests/proxymodeltestapp/breadcrumbdirectionwidget.h b/tests/proxymodeltestapp/breadcrumbdirectionwidget.h similarity index 100% rename from autotests/proxymodeltestapp/breadcrumbdirectionwidget.h rename to tests/proxymodeltestapp/breadcrumbdirectionwidget.h diff --git a/autotests/proxymodeltestapp/breadcrumbnavigationwidget.cpp b/tests/proxymodeltestapp/breadcrumbnavigationwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/breadcrumbnavigationwidget.cpp rename to tests/proxymodeltestapp/breadcrumbnavigationwidget.cpp diff --git a/autotests/proxymodeltestapp/breadcrumbnavigationwidget.h b/tests/proxymodeltestapp/breadcrumbnavigationwidget.h similarity index 100% rename from autotests/proxymodeltestapp/breadcrumbnavigationwidget.h rename to tests/proxymodeltestapp/breadcrumbnavigationwidget.h diff --git a/autotests/proxymodeltestapp/breadcrumbswidget.cpp b/tests/proxymodeltestapp/breadcrumbswidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/breadcrumbswidget.cpp rename to tests/proxymodeltestapp/breadcrumbswidget.cpp diff --git a/autotests/proxymodeltestapp/breadcrumbswidget.h b/tests/proxymodeltestapp/breadcrumbswidget.h similarity index 100% rename from autotests/proxymodeltestapp/breadcrumbswidget.h rename to tests/proxymodeltestapp/breadcrumbswidget.h diff --git a/autotests/proxymodeltestapp/checkablewidget.cpp b/tests/proxymodeltestapp/checkablewidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/checkablewidget.cpp rename to tests/proxymodeltestapp/checkablewidget.cpp diff --git a/autotests/proxymodeltestapp/checkablewidget.h b/tests/proxymodeltestapp/checkablewidget.h similarity index 100% rename from autotests/proxymodeltestapp/checkablewidget.h rename to tests/proxymodeltestapp/checkablewidget.h diff --git a/autotests/proxymodeltestapp/descendantpmwidget.cpp b/tests/proxymodeltestapp/descendantpmwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/descendantpmwidget.cpp rename to tests/proxymodeltestapp/descendantpmwidget.cpp diff --git a/autotests/proxymodeltestapp/descendantpmwidget.h b/tests/proxymodeltestapp/descendantpmwidget.h similarity index 100% rename from autotests/proxymodeltestapp/descendantpmwidget.h rename to tests/proxymodeltestapp/descendantpmwidget.h diff --git a/autotests/proxymodeltestapp/kidentityproxymodelwidget.cpp b/tests/proxymodeltestapp/kidentityproxymodelwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/kidentityproxymodelwidget.cpp rename to tests/proxymodeltestapp/kidentityproxymodelwidget.cpp diff --git a/autotests/proxymodeltestapp/kidentityproxymodelwidget.h b/tests/proxymodeltestapp/kidentityproxymodelwidget.h similarity index 100% rename from autotests/proxymodeltestapp/kidentityproxymodelwidget.h rename to tests/proxymodeltestapp/kidentityproxymodelwidget.h diff --git a/autotests/proxymodeltestapp/kreparentingproxymodel.cpp b/tests/proxymodeltestapp/kreparentingproxymodel.cpp similarity index 100% rename from autotests/proxymodeltestapp/kreparentingproxymodel.cpp rename to tests/proxymodeltestapp/kreparentingproxymodel.cpp diff --git a/autotests/proxymodeltestapp/kreparentingproxymodel.h b/tests/proxymodeltestapp/kreparentingproxymodel.h similarity index 100% rename from autotests/proxymodeltestapp/kreparentingproxymodel.h rename to tests/proxymodeltestapp/kreparentingproxymodel.h diff --git a/autotests/proxymodeltestapp/lessthanwidget.cpp b/tests/proxymodeltestapp/lessthanwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/lessthanwidget.cpp rename to tests/proxymodeltestapp/lessthanwidget.cpp diff --git a/autotests/proxymodeltestapp/lessthanwidget.h b/tests/proxymodeltestapp/lessthanwidget.h similarity index 100% rename from autotests/proxymodeltestapp/lessthanwidget.h rename to tests/proxymodeltestapp/lessthanwidget.h diff --git a/autotests/proxymodeltestapp/main.cpp b/tests/proxymodeltestapp/main.cpp similarity index 100% rename from autotests/proxymodeltestapp/main.cpp rename to tests/proxymodeltestapp/main.cpp diff --git a/autotests/proxymodeltestapp/mainwindow.cpp b/tests/proxymodeltestapp/mainwindow.cpp similarity index 100% rename from autotests/proxymodeltestapp/mainwindow.cpp rename to tests/proxymodeltestapp/mainwindow.cpp diff --git a/autotests/proxymodeltestapp/mainwindow.h b/tests/proxymodeltestapp/mainwindow.h similarity index 100% rename from autotests/proxymodeltestapp/mainwindow.h rename to tests/proxymodeltestapp/mainwindow.h diff --git a/autotests/proxymodeltestapp/matchcheckingwidget.cpp b/tests/proxymodeltestapp/matchcheckingwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/matchcheckingwidget.cpp rename to tests/proxymodeltestapp/matchcheckingwidget.cpp diff --git a/autotests/proxymodeltestapp/matchcheckingwidget.h b/tests/proxymodeltestapp/matchcheckingwidget.h similarity index 100% rename from autotests/proxymodeltestapp/matchcheckingwidget.h rename to tests/proxymodeltestapp/matchcheckingwidget.h diff --git a/autotests/proxymodeltestapp/modelcommanderwidget.cpp b/tests/proxymodeltestapp/modelcommanderwidget.cpp similarity index 95% rename from autotests/proxymodeltestapp/modelcommanderwidget.cpp rename to tests/proxymodeltestapp/modelcommanderwidget.cpp index f4adc32..30f60a0 100644 --- a/autotests/proxymodeltestapp/modelcommanderwidget.cpp +++ b/tests/proxymodeltestapp/modelcommanderwidget.cpp @@ -58,7 +58,7 @@ void ModelCommanderWidget::init() m_treeWidget->addTopLevelItem(testFunctionItem); QStringList testData; - QMetaObject::invokeMethod(m_modelCommander, QByteArray("execute_" + testFunctionItem->text(0).toLatin1()), + QMetaObject::invokeMethod(m_modelCommander, QByteArray("execute_" + testFunctionItem->text(0).toLatin1()).constData(), Q_RETURN_ARG(QStringList, testData), Q_ARG(QString, QString())); @@ -99,7 +99,7 @@ void ModelCommanderWidget::initTest(QTreeWidgetItem *item) return; // m_dynamicTreeModel->clear(); } m_dynamicTreeModel->clear(); - bool success = QMetaObject::invokeMethod(m_modelCommander, QByteArray("init_" + item->parent()->text(0).toLatin1()), + bool success = QMetaObject::invokeMethod(m_modelCommander, QByteArray("init_" + item->parent()->text(0).toLatin1()).constData(), Q_ARG(QString, item->text(0))); Q_ASSERT(success); } @@ -110,7 +110,7 @@ void ModelCommanderWidget::executeTest(QTreeWidgetItem *item) return; } - bool success = QMetaObject::invokeMethod(m_modelCommander, QByteArray("execute_" + item->parent()->text(0).toLatin1()), + bool success = QMetaObject::invokeMethod(m_modelCommander, QByteArray("execute_" + item->parent()->text(0).toLatin1()).constData(), Q_ARG(QString, item->text(0))); Q_ASSERT(success); } diff --git a/autotests/proxymodeltestapp/modelcommanderwidget.h b/tests/proxymodeltestapp/modelcommanderwidget.h similarity index 100% rename from autotests/proxymodeltestapp/modelcommanderwidget.h rename to tests/proxymodeltestapp/modelcommanderwidget.h diff --git a/autotests/proxymodeltestapp/proxyitemselectionwidget.cpp b/tests/proxymodeltestapp/proxyitemselectionwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/proxyitemselectionwidget.cpp rename to tests/proxymodeltestapp/proxyitemselectionwidget.cpp diff --git a/autotests/proxymodeltestapp/proxyitemselectionwidget.h b/tests/proxymodeltestapp/proxyitemselectionwidget.h similarity index 100% rename from autotests/proxymodeltestapp/proxyitemselectionwidget.h rename to tests/proxymodeltestapp/proxyitemselectionwidget.h diff --git a/autotests/proxymodeltestapp/proxymodeltestwidget.cpp b/tests/proxymodeltestapp/proxymodeltestwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/proxymodeltestwidget.cpp rename to tests/proxymodeltestapp/proxymodeltestwidget.cpp diff --git a/autotests/proxymodeltestapp/proxymodeltestwidget.h b/tests/proxymodeltestapp/proxymodeltestwidget.h similarity index 100% rename from autotests/proxymodeltestapp/proxymodeltestwidget.h rename to tests/proxymodeltestapp/proxymodeltestwidget.h diff --git a/autotests/proxymodeltestapp/recursivefilterpmwidget.cpp b/tests/proxymodeltestapp/recursivefilterpmwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/recursivefilterpmwidget.cpp rename to tests/proxymodeltestapp/recursivefilterpmwidget.cpp diff --git a/autotests/proxymodeltestapp/recursivefilterpmwidget.h b/tests/proxymodeltestapp/recursivefilterpmwidget.h similarity index 100% rename from autotests/proxymodeltestapp/recursivefilterpmwidget.h rename to tests/proxymodeltestapp/recursivefilterpmwidget.h diff --git a/autotests/proxymodeltestapp/reparenting1.png b/tests/proxymodeltestapp/reparenting1.png similarity index 100% rename from autotests/proxymodeltestapp/reparenting1.png rename to tests/proxymodeltestapp/reparenting1.png diff --git a/autotests/proxymodeltestapp/reparenting2.png b/tests/proxymodeltestapp/reparenting2.png similarity index 100% rename from autotests/proxymodeltestapp/reparenting2.png rename to tests/proxymodeltestapp/reparenting2.png diff --git a/autotests/proxymodeltestapp/reparenting3.png b/tests/proxymodeltestapp/reparenting3.png similarity index 100% rename from autotests/proxymodeltestapp/reparenting3.png rename to tests/proxymodeltestapp/reparenting3.png diff --git a/autotests/proxymodeltestapp/reparentingpmwidget.cpp b/tests/proxymodeltestapp/reparentingpmwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/reparentingpmwidget.cpp rename to tests/proxymodeltestapp/reparentingpmwidget.cpp diff --git a/autotests/proxymodeltestapp/reparentingpmwidget.h b/tests/proxymodeltestapp/reparentingpmwidget.h similarity index 100% rename from autotests/proxymodeltestapp/reparentingpmwidget.h rename to tests/proxymodeltestapp/reparentingpmwidget.h diff --git a/autotests/proxymodeltestapp/scriptablereparentingwidget.cpp b/tests/proxymodeltestapp/scriptablereparentingwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/scriptablereparentingwidget.cpp rename to tests/proxymodeltestapp/scriptablereparentingwidget.cpp diff --git a/autotests/proxymodeltestapp/scriptablereparentingwidget.h b/tests/proxymodeltestapp/scriptablereparentingwidget.h similarity index 100% rename from autotests/proxymodeltestapp/scriptablereparentingwidget.h rename to tests/proxymodeltestapp/scriptablereparentingwidget.h diff --git a/autotests/proxymodeltestapp/selection.qml b/tests/proxymodeltestapp/selection.qml similarity index 100% rename from autotests/proxymodeltestapp/selection.qml rename to tests/proxymodeltestapp/selection.qml diff --git a/autotests/proxymodeltestapp/selectioninqmlwidget.cpp b/tests/proxymodeltestapp/selectioninqmlwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/selectioninqmlwidget.cpp rename to tests/proxymodeltestapp/selectioninqmlwidget.cpp diff --git a/autotests/proxymodeltestapp/selectioninqmlwidget.h b/tests/proxymodeltestapp/selectioninqmlwidget.h similarity index 100% rename from autotests/proxymodeltestapp/selectioninqmlwidget.h rename to tests/proxymodeltestapp/selectioninqmlwidget.h diff --git a/autotests/proxymodeltestapp/selectionpmwidget.cpp b/tests/proxymodeltestapp/selectionpmwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/selectionpmwidget.cpp rename to tests/proxymodeltestapp/selectionpmwidget.cpp diff --git a/autotests/proxymodeltestapp/selectionpmwidget.h b/tests/proxymodeltestapp/selectionpmwidget.h similarity index 100% rename from autotests/proxymodeltestapp/selectionpmwidget.h rename to tests/proxymodeltestapp/selectionpmwidget.h diff --git a/autotests/proxymodeltestapp/statesaverwidget.cpp b/tests/proxymodeltestapp/statesaverwidget.cpp similarity index 100% rename from autotests/proxymodeltestapp/statesaverwidget.cpp rename to tests/proxymodeltestapp/statesaverwidget.cpp diff --git a/autotests/proxymodeltestapp/statesaverwidget.h b/tests/proxymodeltestapp/statesaverwidget.h similarity index 100% rename from autotests/proxymodeltestapp/statesaverwidget.h rename to tests/proxymodeltestapp/statesaverwidget.h