Use OWNCLOUD_BIN_DIR directly in C++ code.
authorHefee <hefee@netzguerilla.net>
Thu, 6 Jul 2017 06:41:02 +0000 (08:41 +0200)
committerHefee <hefee@netzguerilla.net>
Thu, 6 Jul 2017 06:41:02 +0000 (08:41 +0200)
No need to do a STR replacement and the macro changing the path.
It actually broke test execution for Debian.

See https://bugs.debian.org/844937

test/owncloud_add_test.cmake
test/testutility.cpp

index bf15ab890b31548f07a450a3f938e31c589f9264..cefe264eac316aa5f72e6557fb960870cc152d56 100644 (file)
@@ -22,7 +22,7 @@ macro(owncloud_add_test test_class additional_cpp)
     )
 
     add_definitions(-DOWNCLOUD_TEST)
-    add_definitions(-DOWNCLOUD_BIN_PATH=${CMAKE_BINARY_DIR}/bin)
+    add_definitions(-DOWNCLOUD_BIN_PATH="${CMAKE_BINARY_DIR}/bin")
     add_test(NAME ${OWNCLOUD_TEST_CLASS}Test COMMAND ${OWNCLOUD_TEST_CLASS}Test)
 endmacro()
 
@@ -51,5 +51,5 @@ macro(owncloud_add_benchmark test_class additional_cpp)
     )
 
     add_definitions(-DOWNCLOUD_TEST)
-    add_definitions(-DOWNCLOUD_BIN_PATH=${CMAKE_BINARY_DIR}/bin)
+    add_definitions(-DOWNCLOUD_BIN_PATH="${CMAKE_BINARY_DIR}/bin")
 endmacro()
index 5a656ac846bf31cd2a7b47cb115bd2ab6ec17052..5093ce76de7093fd08ad34d2a3947f583684054a 100644 (file)
 
 #include "utility.h"
 
-#define STR_(X) #X
-#define STR(X) STR_(X)
-#define BIN_PATH STR(OWNCLOUD_BIN_PATH)
-
 using namespace OCC::Utility;
 
 class TestUtility : public QObject
@@ -118,7 +114,7 @@ private slots:
             }
             // pass the binary name owncloud to the next call. This brakes branding,
             // but branding is not supposed to work with this.
-            QString ver = versionOfInstalledBinary(BIN_PATH+QLatin1String("/owncloud"));
+            QString ver = versionOfInstalledBinary(OWNCLOUD_BIN_PATH+QLatin1String("/owncloud"));
            qDebug() << "Version of installed ownCloud Binary: " << ver;
            QVERIFY( !ver.isEmpty());