[kdev-qmake] tests: Little test fix : old sessions makes test crash

Milian Wolff mail at milianw.de
Thu Mar 3 21:19:59 UTC 2011


Julien Desgats, 03.03.2011:
> Git commit da2f8d0f8163c2c3f3996ffb31d20be6db326ab7 by Julien Desgats.
> Committed on 03/03/2011 at 21:32.
> Pushed by desgats into branch 'master'.
> 
> Little test fix : old sessions makes test crash
> 
> M  +6    -1    tests/test_qmakeproject.cpp
> 
> http://commits.kde.org/kdev-qmake/da2f8d0f8163c2c3f3996ffb31d20be6db326ab7
> 
> diff --git a/tests/test_qmakeproject.cpp b/tests/test_qmakeproject.cpp
> index cdffbd8..993f289 100644
> --- a/tests/test_qmakeproject.cpp
> +++ b/tests/test_qmakeproject.cpp
> @@ -34,6 +34,7 @@
>  #include <KUrl>
>  #include <KConfigGroup>
>  #include <KDebug>
> +#include <kio/deletejob.h>
> 
>  QTEST_KDEMAIN(TestQMakeProject, GUI);
> 
> @@ -41,8 +42,12 @@ using namespace KDevelop;
> 
>  TestQMakeProject::TestQMakeProject(QObject* parent): QObject(parent)
>  {
> +    // be sure that we crate a new session (reuse an existing session
> makes the test crash) +    KIO::DeleteJob *job =
> KIO::del(KUrl(QString(getenv("KDEHOME")) +
> "/share/apps/qttest/sessions")); +    QTest::kWaitForSignal(job,
> SIGNAL(result(KJob*)), 10000);
> +
>      AutoTestShell::init();
> -    Core::initialize(0, Core::Default, "QMake_test_session");
> +    Core::initialize(0, Core::Default);
>      QTest::qWait(500); //wait for previously loaded projects
>  }

this must be removed as it's too dangerous. If one runs the test with the 
wrong envvar set one would delete all his sessions. there should be a 
different solution, e.g. by marking a session temporary - afair we have that 
for debugging already (e.g. kdevelop -d gdb kate)

bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110303/ca1d67c0/attachment.sig>


More information about the KDevelop-devel mailing list