Commit 437ade20 authored by Evgeniy Ivanov's avatar Evgeniy Ivanov
Browse files

Minor changes (kind of fixes) in idvcsexecutor::addFileList.

Additional tests for Git (mostly for idvcsexecutor).
parent 7fdbdf46
......@@ -26,7 +26,7 @@ if (GIT)
${CMAKE_SOURCE_DIR}/vcs/dvcs/
)
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
set(gitInitTest_SRCS initTest.cpp ${CMAKE_SOURCE_DIR}/vcs/dvcs/idvcsexecutor.cpp ../gitexecutor.cpp)
set(gitInitTest_SRCS initTest.cpp ../gitexecutor.cpp)
kde4_add_unit_test(kdevgit-test ${gitInitTest_SRCS})
target_link_libraries(kdevgit-test
${QT_QTTEST_LIBRARY}
......
......@@ -109,7 +109,16 @@ void GitInitTest::addFiles()
f.flush();
f.close();
DVCSjob* j = m_proxy->add(QString(GITTEST_BASEDIR), KUrl::List(QStringList(QString(GIT_TESTFILE_NAME))));
//add always should use relative path to the any directory of the repository, let's check:
DVCSjob* j = m_proxy->add(QString(GITTEST_BASEDIR), KUrl::List(QStringList(QString(GITTEST_DIR1))));
QVERIFY( j );
if (j)
QVERIFY(j->exec() );
//Wait the job will be finished
while(j->status() == KDevelop::VcsJob::JobRunning) ;
j = m_proxy->add(QString(GITTEST_BASEDIR), KUrl::List(QStringList(QString(GIT_TESTFILE_NAME))));
QVERIFY( j );
if (j)
......@@ -216,14 +225,20 @@ void GitInitTest::cloneRepository()
QVERIFY( QFileInfo(QString(GITTEST_BASEDIR2"kdevGit_testdir/.git/")).exists() );
}
void GitInitTest::testInitAndCommit()
void GitInitTest::testInit()
{
repoInit();
}
void GitInitTest::testAdd()
{
addFiles();
commitFiles();
cloneRepository();
}
void GitInitTest::testCommit()
{
commitFiles();
}
KDEVTEST_MAIN(GitInitTest)
......
......@@ -43,7 +43,9 @@ class GitInitTest: public QObject
private slots:
void initTestCase();
void testInitAndCommit();
void testInit();
void testAdd();
void testCommit();
void cleanupTestCase();
private:
......
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