Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
Add functional tests to travis (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
uglide committed Nov 28, 2017
1 parent e93c09a commit 9e39825
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
15 changes: 13 additions & 2 deletions .travis.yml
Expand Up @@ -16,6 +16,7 @@ install:
- sudo apt-get install qt${RDM_QT_VERSION:0:2}base libssl1.0.0 -y -qq
- sudo apt-get install gcc-4.9 g++-4.9 gdb lcov valgrind cmake -y -qq
- if [ "$RDM_QT_VERSION" == "591" ]; then
sudo apt-get install python3 python-virtualenv -y -qq &&
sudo apt-get install dropbear -y -qq &&
sudo mkdir -p /etc/dropbear &&
sudo useradd -d /home/rdm -s /bin/bash -p $(echo test | openssl passwd -1 -stdin) rdm &&
Expand Down Expand Up @@ -56,8 +57,18 @@ install:
- gcc --version
- gcov --version
script:
- if [ "$RDM_QT_VERSION" == "591" ]; then cd ./tests/unit_tests && ./run_tests; fi
- qmake && make
- if [ "$RDM_QT_VERSION" == "591" ]; then pushd ./tests/unit_tests && ./run_tests && popd; fi
- if [ "$RDM_QT_VERSION" == "591" ]; then
pushd ./tests/functional &&
mkdir bin &&
qmake "DESTDIR=./bin/" && make -s &&
virtualenv .venv -p python3 &&
source .venv/bin/activate &&
pip install -r requirements.txt &&
python tests.py &&
popd;
fi
- qmake && make -s
after_success:
- if [ "$RDM_QT_VERSION" == "591" ]; then coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info.filtered; fi
services:
Expand Down
6 changes: 1 addition & 5 deletions tests/functional/main.cpp
Expand Up @@ -49,17 +49,13 @@ int main(int argc, char *argv[])

QJsonArray allCommands = commands.array();

RedisClient::ConnectionConfig config("127.0.0.1");
RedisClient::ConnectionConfig config("127.0.0.1", "test");
config.setPort(6379);
RedisClient::Connection connection(config);

int processedCommandsCount = 0;
int errorsCount = 0;

QObject::connect(&connection, &RedisClient::Connection::log, [](QString msg) {
qDebug() << "Connection:" << msg;
});

QObject::connect(&connection, &RedisClient::Connection::error, [&errorsCount](QString msg) {
qDebug() << "Connection error:" << msg;
errorsCount++;
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/qredis-runner.pro
Expand Up @@ -6,6 +6,8 @@ TEMPLATE = app
CONFIG += debug c++11 console
CONFIG-=app_bundle

DEFINES += QT_NO_DEBUG_OUTPUT

PROJECT_ROOT = $$PWD/../../
DESTDIR = $$PWD/bin

Expand Down

0 comments on commit 9e39825

Please sign in to comment.