Skip to content

Commit

Permalink
Add Xvfb in travis for XServer simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
aroquemaurel committed Apr 5, 2015
1 parent 8f9c5f0 commit 84fb2fe
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ install:
- sudo apt-get install texlive texlive-fonts-extra latex-xcolor texlive-extra-utils texlive-font-utils
- sudo apt-get install libmysqld-dev libmysqlclient-dev libqt5sql5-mysql libqt4-sql-mysql
- sudo apt-get install mlocate
- sudo apt-get install xvfb
- wget -O Qt5.2.0.tar.xz https://www.dropbox.com/s/mkqtb8teeydsmrk/Qt5.2.0.tar.xz?dl=0
- mkdir ~/Qt5.2.0
- tar -xJf Qt5.2.0.tar.xz -C ~/Qt5.2.0
Expand Down
4 changes: 3 additions & 1 deletion scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ echo "#### COMPILATION ####"
make -j9 >> /dev/null
LD_LIBRARY_PATH=`pwd`/src
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
Xvfb :1 &
ln -s `pwd`/src/sql `pwd`/tests/sql
echo "### TESTS EXECUTION"
cd tests
./tests 127.0.0.1 FactDev FactDev
DISPLAY=:1 ./tests 127.0.0.1 FactDev FactDev
pkill Xvfb
7 changes: 7 additions & 0 deletions tests/database/customerdatabasetest.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "customerdatabasetest.h"
#include "database/customerdatabase.h"

#include <QPixmap>
CustomerDatabaseTest::CustomerDatabaseTest()
{
c1.setAddress("Address");
Expand Down Expand Up @@ -116,6 +117,12 @@ void CustomerDatabaseTest::getTreeException()
} catch(DbException*) {
QVERIFY(true);
}
try {
Databases::CustomerDatabase::instance()->getTree();
QVERIFY(true);
} catch(DbException*) {
QFAIL("Exception not thrown");
}

}
void CustomerDatabaseTest::getNbCustomersTest() {
Expand Down
2 changes: 1 addition & 1 deletion tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int sqliteExecution(QCoreApplication& a);

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QApplication a(argc, argv);
int ret = 0;

if(sqliteExecution(a) != 0) {
Expand Down
5 changes: 5 additions & 0 deletions tests/models/usermodeltest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ UserModelTest::UserModelTest()
u2.setNoSiret("12345678912340");
u2.setPdflatexPath("pdflatex");



}

void UserModelTest::equals1()
{
u1.setExtensionImage("jpg");
QVERIFY(u1.getExtensionImage() == "jpg");

QVERIFY(u1 == u2);
}

Expand Down

0 comments on commit 84fb2fe

Please sign in to comment.