Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8f265cca authored by Miha Čančula's avatar Miha Čančula

Fix ctestsuites unit test

Use enable_testing() to always create a CTestTestfile, and prune
the test project after each test run to remove any stale files.
parent 1c2334df
......@@ -8,7 +8,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(ECMAddTests)
set(ENABLE_TESTING ON)
enable_testing()
set(CMAKE_AUTOMOC ON)
ecm_add_test(test.cpp TEST_NAME cmake-test-unittestskde)
......
......@@ -32,6 +32,8 @@
#include <interfaces/itestsuite.h>
#include <interfaces/iprojectcontroller.h>
#include <interfaces/iproject.h>
#include <interfaces/ibuildsystemmanager.h>
#include <interfaces/iprojectbuilder.h>
#include <testing/ctestsuite.h>
#include <tests/autotestshell.h>
#include <tests/testcore.h>
......@@ -39,6 +41,7 @@
#include <QDir>
#include <QtTest>
#include <KJob>
Q_DECLARE_METATYPE(KDevelop::ITestSuite*)
......@@ -65,7 +68,12 @@ void TestCTestFindSuites::initTestCase()
void TestCTestFindSuites::cleanup()
{
foreach(IProject* p, ICore::self()->projectController()->projects()) {
foreach(IProject* p, ICore::self()->projectController()->projects())
{
if (p && p->buildSystemManager() && p->buildSystemManager()->builder())
{
p->buildSystemManager()->builder()->prune(p)->exec();
}
ICore::self()->projectController()->closeProject(p);
}
QVERIFY(ICore::self()->projectController()->projects().isEmpty());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment