Fix build&run of tests

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit fb0dff6330)
r14.1.x r14.1.5
Alexander Golubev 7 months ago
parent 0292a9a6ec
commit 68558afe79

@ -1,14 +1,15 @@
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
macro(build_TEST tname)
macro(build_test tname)
set(${tname}-src ${tname}.cpp)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${tname}.h)
set(${tname}-src ${${tname}-src} ${tname}.h)
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${tname}.h)
add_executable(${tname} ${${tname}-src})
target_link_libraries(${tname} ${svnqt-name} ${TQT_LIBRARIES})
add_test(${tname} ${CMAKE_CURRENT_BINARY_DIR}/${tname})
endmaCRO(BUILD_TEST)
# FIXME: sqlite test relies on now defunc web service
# add_test(${tname} ${CMAKE_CURRENT_BINARY_DIR}/${tname})
endmaCRO(build_test)
if (BUILD_TESTS)
configure_file(

@ -7,19 +7,12 @@
#include "svnqt/client.h"
#include "svnqt/svnqttypes.h"
#include "svnqt/log_entry.h"
#include "svnqt/cache/LogCache.h"
#include "svnqt/cache/ReposLog.h"
#include "svnqt/cache/test/testconfig.h"
#include "svnqt/cache/DatabaseException.h"
#if [[[TQT_VERSION IS DEPRECATED]]] < 0x040000
#else
#include <TQSqlQuery>
#include <TQSqlError>
#endif
int main(int argc,char**argv)
{
TQApplication app(argc,argv);
@ -43,19 +36,11 @@ int main(int argc,char**argv)
}
svn::cache::ReposLog rl(m_Svnclient,"http://www.alwins-world.de/repos/tdesvn");
TQDataBase db = rl.Database();
#if [[[TQT_VERSION IS DEPRECATED]]] < 0x040000
if (!db) {
#else
if (!db.isValid()) {
#endif
std::cerr << "No database object."<<std::endl;
exit(-1);
}
#if [[[TQT_VERSION IS DEPRECATED]]] < 0x040000
list = db->tables();
#else
list = db.tables();
#endif
it = list.begin();
while( it != list.end() ) {
std::cout << ( *it ).TOUTF8().data() << std::endl;
@ -91,10 +76,6 @@ int main(int argc,char**argv)
q.exec();
std::cerr << "\n" << q.lastError().text().TOUTF8().data()<<std::endl;
#if [[[TQT_VERSION IS DEPRECATED]]] < 0x040000
#else
db=TQSqlDatabase();
#endif
try {
rl.log("/trunk/src/svnqt",1,1000,svn::Revision::UNDEFINED,lm,false,-1);
}

@ -20,7 +20,6 @@
#include "client.h"
#include "repository.h"
#include "context.h"
#include "datetime.h"
#include <tqdatastream.h>
@ -31,9 +30,7 @@ int main(int,char**)
svn::ContextP myContext = new svn::Context();
TQByteArray tout;
#if [[[TQT_VERSION IS DEPRECATED]]] < 0x040000
TQDataStream out(tout,IO_WriteOnly);
#endif
svn::Client*m_Svnclient = svn::Client::getobject(0,0);
svn::ContextP m_CurrentContext = new svn::Context();
m_Svnclient->setContext(m_CurrentContext);
@ -45,7 +42,6 @@ int main(int,char**)
} catch (svn::ClientException ce) {
gotit = false;
}
#if [[[TQT_VERSION IS DEPRECATED]]] < 0x040000
if (gotit) {
out << m_OldHistory;
svn::LogEntriesMap m_NewHistory;
@ -57,6 +53,5 @@ int main(int,char**)
tqDebug("%lu %s %s",it.key(),it.data().author.ascii(),it.data().message.ascii());
}
}
#endif
return 1;
return 1;
}

@ -1,3 +1,4 @@
include_directories( ${CMAKE_SOURCE_DIR} )
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
macro(build_test tname)
@ -8,16 +9,17 @@ macro(build_test tname)
add_executable(${tname} ${${tname}-src})
target_link_libraries(${tname} ${svnqt-name} ${TQT_LIBRARIES})
add_test(${tname} ${CMAKE_CURRENT_BINARY_DIR}/${tname})
endmacro(BUILD_TEST)
endmacro(build_test)
if (BUILD_TESTS)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/testconfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/testconfig.h
)
add_test(rmrepo "/bin/rm" "-rvf" "${CMAKE_CURRENT_BINARY_DIR}/repo")
add_test(rmco "/bin/rm" "-rvf" "${CMAKE_CURRENT_BINARY_DIR}/co")
build_test(crepo)
build_test(lsdir)
build_test(ckpath)
# lsdir relies on output from crepo
set_tests_properties(crepo lsdir PROPERTIES RUN_SERIAL TRUE)
endif(BUILD_TESTS)

@ -15,7 +15,7 @@ int main(int,char**)
}
unsigned j = 0;
while (pa.length()>0) {
std::cout << pa.path() << std::endl;
std::cout << pa.path().local8Bit() << std::endl;
pa.removeLast();
++j;
}

@ -17,17 +17,19 @@ class Listener:public svn::repository::RepositoryListener
virtual ~Listener(){}
virtual void sendWarning(const TQString&msg)
{
std::cout << msg << std::endl;
std::cout << msg.local8Bit() << std::endl;
}
virtual void sendError(const TQString&msg)
{
std::cout << msg << std::endl;
std::cout << msg.local8Bit() << std::endl;
}
virtual bool isCanceld(){return false;}
};
int main(int,char**)
{
system("/bin/rm -rvf -- " TESTREPOPATH " " TESTCOPATH);
TQString p = TESTREPOPATH;
Listener ls;
svn::repository::Repository rp(&ls);

@ -28,8 +28,8 @@ int main(int,char**)
std::cout << "List 1 "<<dlist.size()<<std::endl;
for (unsigned int i=0; i < dlist.size();++i) {
TQDateTime dt = svn::DateTime(dlist[i]->time());
std::cout << dlist[i]->name() << " "
<< dlist[i]->lastAuthor() << " "
std::cout << dlist[i]->name().local8Bit() << " "
<< dlist[i]->lastAuthor().local8Bit() << " "
<< dlist[i]->size() << " "
<< dt.toTime_t() << std::endl;
}
@ -44,8 +44,8 @@ int main(int,char**)
std::cout << "List 2 "<<dlist.size()<<std::endl;
for (unsigned int i=0; i < dlist.size();++i) {
TQDateTime dt = svn::DateTime(dlist[i]->time());
std::cout << dlist[i]->name() << " "
<< dlist[i]->lastAuthor() << " "
std::cout << dlist[i]->name().local8Bit() << " "
<< dlist[i]->lastAuthor().local8Bit() << " "
<< dlist[i]->size() << " "
<< dt.toTime_t() << std::endl;
}
@ -59,7 +59,7 @@ int main(int,char**)
return -1;
}
for (unsigned int i=0; i < slist.size();++i) {
std::cout << slist[i]->path()<< std::endl;
std::cout << slist[i]->path().local8Bit() << std::endl;
}
std::cout << "================"<<std::endl;
std::cout << "Second status:"<<std::endl;
@ -71,7 +71,7 @@ int main(int,char**)
return -1;
}
for (unsigned int i=0; i < slist.size();++i) {
std::cout << slist[i]->path()<< std::endl;
std::cout << slist[i]->path().local8Bit() << std::endl;
}
return 0;

Loading…
Cancel
Save