Changeset - a9fbe73b8025
[Not reviewed]
0 4 0
Jan Kaluza - 14 years ago 2011-06-08 13:17:09
hanzz.k@gmail.com
Tests tweaking
4 files changed with 19 insertions and 10 deletions:
0 comments (0 inline, 0 general)
include/transport/transport.h
Show inline comments
 
@@ -31,6 +31,7 @@
 
#include "Swiften/Network/BoostTimerFactory.h"
 
#include "Swiften/Network/BoostIOServiceThread.h"
 
#include "Swiften/Server/UserRegistry.h"
 
#include "Swiften/Base/SafeByteArray.h"
 
#include <boost/bind.hpp>
 
#include "transport/config.h"
 
#include "transport/factory.h"
tests/login/CMakeLists.txt
Show inline comments
 
@@ -2,5 +2,5 @@ FILE(GLOB SRC *.cpp)
 
 
ADD_EXECUTABLE(login_test ${SRC})
 
 
TARGET_LINK_LIBRARIES(login_test transport ${SWIFTEN_LIBRARIES})
 
TARGET_LINK_LIBRARIES(login_test transport ${SWIFTEN_LIBRARIES} -lgconf-2 -lgobject-2.0 -lglib-2.0)
 
tests/login/main.cpp
Show inline comments
 
@@ -2,6 +2,7 @@
 
#include <boost/bind.hpp>
 

	
 
#include <Swiften/Swiften.h>
 
#include <Swiften/Client/ClientOptions.h>
 

	
 
using namespace Swift;
 
using namespace boost;
 
@@ -9,12 +10,12 @@ using namespace boost;
 
Client* client;
 

	
 
static void handleDisconnected(const boost::optional<ClientError> &) {
 
	std::cout << "Disconnected..." << std::endl;
 
// 	std::cout << "Disconnected..." << std::endl;
 
	exit(1);
 
}
 

	
 
static void handleConnected() {
 
	std::cout << "Connected..." << std::endl;
 
// 	std::cout << "Connected..." << std::endl;
 
	exit(0);
 
}
 

	
 
@@ -31,11 +32,12 @@ int main(int, char **argv) {
 

	
 
	client = new Client(argv[1], argv[2], &networkFactories);
 
	client->setAlwaysTrustCertificates();
 
	client->setAllowPLAINOverNonTLS(true);
 
	client->onConnected.connect(&handleConnected);
 
	client->onDisconnected.connect(bind(&handleDisconnected, _1));
 
	client->onMessageReceived.connect(bind(&handleMessageReceived, _1));
 
	client->connect();
 
	ClientOptions opt;
 
	opt.allowPLAINOverNonTLS = true;
 
	client->connect(opt);
 

	
 
	eventLoop.run();
 

	
tests/runtests.py
Show inline comments
 
@@ -21,12 +21,13 @@ def run_spectrum(backend):
 
	" % (backend, backend)
 
	)
 
	f.close()
 
	p = Popen("../spectrum/src/spectrum sample.cfg > /dev/null 2> /dev/null", shell=True)
 
	time.sleep(1)
 
	p = Popen("../spectrum/src/spectrum sample.cfg >> test.log 2> /dev/null", shell=True)
 
	time.sleep(2)
 
	return p
 

	
 

	
 
os.system("killall spectrum 2> /dev/null")
 
os.system("rm test.log")
 

	
 
for backend in os.listdir("../backends"):
 
	if not os.path.isdir("../backends/" + backend) or backend == "CMakeFiles":
 
@@ -40,10 +41,15 @@ for backend in os.listdir("../backends"):
 
		p = run_spectrum(backend);
 

	
 
		if backend.find("purple") >= 0:
 
			ret = os.system(binary + " pyjim%jabber.cz@localhost test")
 
			p = Popen(binary + " pyjim%jabber.cz@localhost test", shell=True)
 
			
 
		else:
 
			ret = os.system(binary + " testnickname%irc.freenode.net@localhost test")
 
		if ret == 0:
 
			p = Popen(binary + " testnickname%irc.freenode.net@localhost test", shell=True)
 

	
 
		time.sleep(5)
 

	
 
		p.poll()
 
		if p.returncode == 0:
 
			print "[ PASS ]", backend, binary
 
		else:
 
			print "[ FAIL ]", backend, binary
0 comments (0 inline, 0 general)