Tests tweaking
This commit is contained in:
parent
a74d8f27a7
commit
a9fbe73b80
4 changed files with 19 additions and 10 deletions
|
@ -31,6 +31,7 @@
|
||||||
#include "Swiften/Network/BoostTimerFactory.h"
|
#include "Swiften/Network/BoostTimerFactory.h"
|
||||||
#include "Swiften/Network/BoostIOServiceThread.h"
|
#include "Swiften/Network/BoostIOServiceThread.h"
|
||||||
#include "Swiften/Server/UserRegistry.h"
|
#include "Swiften/Server/UserRegistry.h"
|
||||||
|
#include "Swiften/Base/SafeByteArray.h"
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include "transport/config.h"
|
#include "transport/config.h"
|
||||||
#include "transport/factory.h"
|
#include "transport/factory.h"
|
||||||
|
|
|
@ -2,5 +2,5 @@ FILE(GLOB SRC *.cpp)
|
||||||
|
|
||||||
ADD_EXECUTABLE(login_test ${SRC})
|
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)
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
|
|
||||||
#include <Swiften/Swiften.h>
|
#include <Swiften/Swiften.h>
|
||||||
|
#include <Swiften/Client/ClientOptions.h>
|
||||||
|
|
||||||
using namespace Swift;
|
using namespace Swift;
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
|
@ -9,12 +10,12 @@ using namespace boost;
|
||||||
Client* client;
|
Client* client;
|
||||||
|
|
||||||
static void handleDisconnected(const boost::optional<ClientError> &) {
|
static void handleDisconnected(const boost::optional<ClientError> &) {
|
||||||
std::cout << "Disconnected..." << std::endl;
|
// std::cout << "Disconnected..." << std::endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handleConnected() {
|
static void handleConnected() {
|
||||||
std::cout << "Connected..." << std::endl;
|
// std::cout << "Connected..." << std::endl;
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,11 +32,12 @@ int main(int, char **argv) {
|
||||||
|
|
||||||
client = new Client(argv[1], argv[2], &networkFactories);
|
client = new Client(argv[1], argv[2], &networkFactories);
|
||||||
client->setAlwaysTrustCertificates();
|
client->setAlwaysTrustCertificates();
|
||||||
client->setAllowPLAINOverNonTLS(true);
|
|
||||||
client->onConnected.connect(&handleConnected);
|
client->onConnected.connect(&handleConnected);
|
||||||
client->onDisconnected.connect(bind(&handleDisconnected, _1));
|
client->onDisconnected.connect(bind(&handleDisconnected, _1));
|
||||||
client->onMessageReceived.connect(bind(&handleMessageReceived, _1));
|
client->onMessageReceived.connect(bind(&handleMessageReceived, _1));
|
||||||
client->connect();
|
ClientOptions opt;
|
||||||
|
opt.allowPLAINOverNonTLS = true;
|
||||||
|
client->connect(opt);
|
||||||
|
|
||||||
eventLoop.run();
|
eventLoop.run();
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,13 @@ def run_spectrum(backend):
|
||||||
" % (backend, backend)
|
" % (backend, backend)
|
||||||
)
|
)
|
||||||
f.close()
|
f.close()
|
||||||
p = Popen("../spectrum/src/spectrum sample.cfg > /dev/null 2> /dev/null", shell=True)
|
p = Popen("../spectrum/src/spectrum sample.cfg >> test.log 2> /dev/null", shell=True)
|
||||||
time.sleep(1)
|
time.sleep(2)
|
||||||
return p
|
return p
|
||||||
|
|
||||||
|
|
||||||
os.system("killall spectrum 2> /dev/null")
|
os.system("killall spectrum 2> /dev/null")
|
||||||
|
os.system("rm test.log")
|
||||||
|
|
||||||
for backend in os.listdir("../backends"):
|
for backend in os.listdir("../backends"):
|
||||||
if not os.path.isdir("../backends/" + backend) or backend == "CMakeFiles":
|
if not os.path.isdir("../backends/" + backend) or backend == "CMakeFiles":
|
||||||
|
@ -40,10 +41,15 @@ for backend in os.listdir("../backends"):
|
||||||
p = run_spectrum(backend);
|
p = run_spectrum(backend);
|
||||||
|
|
||||||
if backend.find("purple") >= 0:
|
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:
|
else:
|
||||||
ret = os.system(binary + " testnickname%irc.freenode.net@localhost test")
|
p = Popen(binary + " testnickname%irc.freenode.net@localhost test", shell=True)
|
||||||
if ret == 0:
|
|
||||||
|
time.sleep(5)
|
||||||
|
|
||||||
|
p.poll()
|
||||||
|
if p.returncode == 0:
|
||||||
print "[ PASS ]", backend, binary
|
print "[ PASS ]", backend, binary
|
||||||
else:
|
else:
|
||||||
print "[ FAIL ]", backend, binary
|
print "[ FAIL ]", backend, binary
|
||||||
|
|
Loading…
Add table
Reference in a new issue