summaryrefslogtreecommitdiffstats
path: root/src/svnqt/tests/crepo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/svnqt/tests/crepo.cpp')
-rw-r--r--src/svnqt/tests/crepo.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/svnqt/tests/crepo.cpp b/src/svnqt/tests/crepo.cpp
new file mode 100644
index 0000000..604e4e9
--- /dev/null
+++ b/src/svnqt/tests/crepo.cpp
@@ -0,0 +1,63 @@
+#include "src/svnqt/client.hpp"
+#include "src/svnqt/tests/testconfig.h"
+#include "src/svnqt/repository.hpp"
+#include "src/svnqt/repositorylistener.hpp"
+#include "src/svnqt/targets.hpp"
+
+#include "testlistener.h"
+
+#include <iostream>
+#include <unistd.h>
+#include <qstringlist.h>
+
+class Listener:public svn::repository::RepositoryListener
+{
+ public:
+ Listener(){}
+ virtual ~Listener(){}
+ virtual void sendWarning(const QString&msg)
+ {
+ std::cout << msg << std::endl;
+ }
+ virtual void sendError(const QString&msg)
+ {
+ std::cout << msg << std::endl;
+ }
+ virtual bool isCanceld(){return false;}
+};
+
+int main(int,char**)
+{
+ QString p = TESTREPOPATH;
+ Listener ls;
+ svn::repository::Repository rp(&ls);
+ try {
+ rp.CreateOpen(p,"fsfs");
+ } catch (svn::ClientException e) {
+ QString ex = e.msg();
+ std::cout << ex.TOUTF8() << std::endl;
+ return -1;
+ }
+
+ svn::ContextP m_CurrentContext;
+ svn::Client* m_Svnclient;
+ m_Svnclient=svn::Client::getobject(0,0);
+ TestListener tl;
+ m_CurrentContext = new svn::Context();
+ m_CurrentContext->setListener(&tl);
+ p = "file://"+p;
+
+ m_Svnclient->setContext(m_CurrentContext);
+ QStringList s; s.append(p+"/trunk"); s.append(p+"/branches"); s.append(p+"/tags");
+
+ try {
+ m_Svnclient->mkdir(svn::Targets(s),"Test mkdir");
+ m_Svnclient->checkout(p,TESTCOPATH,svn::Revision::HEAD,svn::Revision::HEAD,svn::DepthInfinity,false);
+ } catch (svn::ClientException e) {
+ QString ex = e.msg();
+ std::cout << ex.TOUTF8() << std::endl;
+ return -1;
+ }
+
+ return 0;
+}