Tests: Make independent of an hardcoded path, rather use CMAKE_BINARY_DIR.

This commit is contained in:
Klaas Freitag 2015-07-31 15:28:31 +02:00
parent 92513207eb
commit 579e24be10
3 changed files with 9 additions and 2 deletions

View file

@ -25,6 +25,8 @@ if( UNIX AND NOT APPLE )
owncloud_add_test(InotifyWatcher "${FolderWatcher_SRC}")
endif(UNIX AND NOT APPLE)
configure_file(oc_bin.h.in oc_bin.h)
owncloud_add_test(CSyncSqlite "")
owncloud_add_test(NetrcParser ../src/cmd/netrcparser.cpp)
owncloud_add_test(OwnSql "")

3
test/oc_bin.h.in Normal file
View file

@ -0,0 +1,3 @@
#define OWNCLOUD_BIN "@CMAKE_BINARY_DIR@/bin/owncloud"

View file

@ -11,6 +11,8 @@
#include "utility.h"
#include "oc_bin.h"
using namespace OCC::Utility;
class TestUtility : public QObject
@ -107,9 +109,9 @@ private slots:
void testVersionOfInstalledBinary()
{
if( isLinux() ) {
QString ver = versionOfInstalledBinary("/home/kf/owncloud.com/buildmirall/bin/owncloud");
QString ver = versionOfInstalledBinary(OWNCLOUD_BIN);
qDebug() << "Version of installed ownCloud Binary: " << ver;
QVERIFY( !ver.isEmpty());
QVERIFY( !ver.isEmpty());
} else {
QVERIFY( versionOfInstalledBinary().isEmpty());
}