Add line for debugging
[kdevelopdvcssupport.git] / vcs / dvcs / test2 / dvcsjobTest.cpp
blobe61954c26d20e6d103a3366796c36f095c56411e
1 /***************************************************************************
2 * Copyright 2008 Evgeniy Ivanov <powerfox@kde.ru> *
3 * *
4 * This program is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU General Public License as *
6 * published by the Free Software Foundation; either version 2 of *
7 * the License or (at your option) version 3 or any later version *
8 * accepted by the membership of KDE e.V. (or its successor approved *
9 * by the membership of KDE e.V.), which shall act as a proxy *
10 * defined in Section 14 of version 3 of the license. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19 ***************************************************************************/
21 #include "dvcsjobTest.h"
23 #include <QApplication>
24 #include <QtTest/QtTest>
25 #include <QTimer>
27 #include <KDE/KUrl>
29 #include <vcs/dvcs/dvcsjob.h>
31 void DVCSjobTest::checkDVCS()
33 qDebug() << "check!!!";
34 DVCSjob* bzrJob = new DVCSjob(0);
35 bzrJob->clear();
36 QVERIFY(bzrJob);
37 QVERIFY(bzrJob->status() == DVCSjob::JobNotStarted);
39 bzrJob->setDirectory("/tmp");
40 *bzrJob << "bzr";
41 *bzrJob << "root";
42 QVERIFY(!bzrJob->exec());
43 if (bzrJob->status() == KDevelop::VcsJob::JobSucceeded)
45 qDebug() << "Dir: /tmp" << " is inside work tree of bzr" ;
48 DVCSjob* hgJob = new DVCSjob(0);
49 hgJob->clear();
50 QVERIFY(hgJob);
51 QVERIFY(hgJob->status() == DVCSjob::JobNotStarted);
52 hgJob->clear();
53 hgJob->setDirectory("/tmp");
54 *hgJob << "hg";
55 *hgJob << "root";
56 QVERIFY(!hgJob->exec());
57 if (hgJob->status() == KDevelop::VcsJob::JobSucceeded)
59 qDebug() << "Dir: /tmp" << " is inside work tree of hg" ;
62 DVCSjob* bzr2Job = new DVCSjob(0);
63 bzr2Job->clear();
64 QVERIFY(bzr2Job);
65 QVERIFY(bzr2Job->status() == DVCSjob::JobNotStarted);
66 bzr2Job->clear();
67 bzr2Job->setDirectory("/tmp");
68 *bzr2Job << "bzr";
69 *bzr2Job << "root";
70 QVERIFY(!bzr2Job->exec());
71 if (bzr2Job->status() == KDevelop::VcsJob::JobSucceeded)
73 qDebug() << "Dir: /tmp" << " is inside work tree of bzr2" ;
76 DVCSjob* hg2Job = new DVCSjob(0);
77 hg2Job->clear();
78 QVERIFY(hg2Job);
79 QVERIFY(hg2Job->status() == DVCSjob::JobNotStarted);
80 hg2Job->clear();
81 hg2Job->setDirectory("/tmp");
82 *hg2Job << "hg";
83 *hg2Job << "root";
84 QVERIFY(!hg2Job->exec());
85 if (hg2Job->status() == KDevelop::VcsJob::JobSucceeded)
87 qDebug() << "Dir: /tmp" << " is inside work tree of hg2" ;
91 int main(int argc, char* argv[])
93 QApplication app(argc, argv);
94 DVCSjobTest tester;
95 QTimer::singleShot(200, &tester, SLOT(checkDVCS()));
96 tester.checkDVCS();
97 // QTimer *timer = new QTimer;
98 // QObject::connect(timer, SIGNAL(timeout()), &tester, SLOT(checkDVCS()));
99 // timer->start(1000);
100 // QTimer *timer2 = new QTimer;
101 // QObject::connect(timer2, SIGNAL(timeout()), &tester, SLOT(checkDVCS()));
102 // timer2->start(2);
103 return app.exec();
106 #include "dvcsjobTest.moc"