From 579e24be10cbfaea04449ebc63fe87e6ea5d6cb9 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Fri, 31 Jul 2015 15:28:31 +0200 Subject: [PATCH] Tests: Make independent of an hardcoded path, rather use CMAKE_BINARY_DIR. --- test/CMakeLists.txt | 2 ++ test/oc_bin.h.in | 3 +++ test/testutility.h | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 test/oc_bin.h.in diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b92f3a677..cff057e77 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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 "") diff --git a/test/oc_bin.h.in b/test/oc_bin.h.in new file mode 100644 index 000000000..4af6176ea --- /dev/null +++ b/test/oc_bin.h.in @@ -0,0 +1,3 @@ + +#define OWNCLOUD_BIN "@CMAKE_BINARY_DIR@/bin/owncloud" + diff --git a/test/testutility.h b/test/testutility.h index 022db1055..87c1351a3 100644 --- a/test/testutility.h +++ b/test/testutility.h @@ -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()); }