mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 11:48:56 +03:00
Fix the UNIT_TESTING build on Windows
- Put all tests in the bin directory so that DLLs can be loaded - Add missing exports - Skip tests that use code depending on zlib - The "GMT" timezone is named differently, use the int constructor instead 5 tests are still failing, it's not really worth fixing at the moment since no developper is currently using Windows as its main platform.
This commit is contained in:
parent
611f633ba8
commit
b26db062d2
9 changed files with 20 additions and 15 deletions
|
@ -7,6 +7,8 @@ endif()
|
||||||
|
|
||||||
project(client)
|
project(client)
|
||||||
|
|
||||||
|
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||||
|
|
||||||
set(OEM_THEME_DIR "" CACHE STRING "Define directory containing a custom theme")
|
set(OEM_THEME_DIR "" CACHE STRING "Define directory containing a custom theme")
|
||||||
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
|
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
|
||||||
include ( ${OEM_THEME_DIR}/OEM.cmake )
|
include ( ${OEM_THEME_DIR}/OEM.cmake )
|
||||||
|
|
|
@ -28,7 +28,6 @@ include(ConfigureChecks.cmake)
|
||||||
|
|
||||||
|
|
||||||
set(SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
set(SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
||||||
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
|
||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ __attribute__ ((packed))
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
void csync_file_stat_free(csync_file_stat_t *st);
|
OCSYNC_EXPORT void csync_file_stat_free(csync_file_stat_t *st);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* context for the treewalk function
|
* context for the treewalk function
|
||||||
|
|
|
@ -56,17 +56,15 @@ int csync_get_statedb_exists(CSYNC *ctx);
|
||||||
*
|
*
|
||||||
* @return 0 on success, less than 0 if an error occurred with errno set.
|
* @return 0 on success, less than 0 if an error occurred with errno set.
|
||||||
*/
|
*/
|
||||||
int csync_statedb_load(CSYNC *ctx, const char *statedb, sqlite3 **pdb);
|
OCSYNC_EXPORT int csync_statedb_load(CSYNC *ctx, const char *statedb, sqlite3 **pdb);
|
||||||
|
|
||||||
int csync_statedb_close(CSYNC *ctx);
|
OCSYNC_EXPORT int csync_statedb_close(CSYNC *ctx);
|
||||||
|
|
||||||
csync_file_stat_t *csync_statedb_get_stat_by_hash(CSYNC *ctx, uint64_t phash);
|
OCSYNC_EXPORT csync_file_stat_t *csync_statedb_get_stat_by_hash(CSYNC *ctx, uint64_t phash);
|
||||||
|
|
||||||
csync_file_stat_t *csync_statedb_get_stat_by_inode(CSYNC *ctx, uint64_t inode);
|
OCSYNC_EXPORT csync_file_stat_t *csync_statedb_get_stat_by_inode(CSYNC *ctx, uint64_t inode);
|
||||||
|
|
||||||
csync_file_stat_t *csync_statedb_get_stat_by_file_id(CSYNC *ctx, const char *file_id);
|
OCSYNC_EXPORT csync_file_stat_t *csync_statedb_get_stat_by_file_id(CSYNC *ctx, const char *file_id);
|
||||||
|
|
||||||
char *csync_statedb_get_etag(CSYNC *ctx, uint64_t jHash);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Query all files metadata inside and below a path.
|
* @brief Query all files metadata inside and below a path.
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# TODO: OSX and LIB_ONLY seem to require this to go to binary dir only
|
# TODO: OSX and LIB_ONLY seem to require this to go to binary dir only
|
||||||
if(NOT TOKEN_AUTH_ONLY)
|
if(NOT TOKEN_AUTH_ONLY)
|
||||||
endif()
|
endif()
|
||||||
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
|
||||||
|
|
||||||
set(synclib_NAME ${APPLICATION_EXECUTABLE}sync)
|
set(synclib_NAME ${APPLICATION_EXECUTABLE}sync)
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ QString OWNCLOUDSYNC_EXPORT longWinPath( const QString& inpath );
|
||||||
*/
|
*/
|
||||||
time_t OWNCLOUDSYNC_EXPORT getModTime(const QString& filename);
|
time_t OWNCLOUDSYNC_EXPORT getModTime(const QString& filename);
|
||||||
|
|
||||||
bool setModTime(const QString &filename, time_t modTime);
|
bool OWNCLOUDSYNC_EXPORT setModTime(const QString &filename, time_t modTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the size for a file
|
* @brief Get the size for a file
|
||||||
|
|
|
@ -12,6 +12,7 @@ macro(owncloud_add_test test_class additional_cpp)
|
||||||
|
|
||||||
add_executable(${OWNCLOUD_TEST_CLASS}Test test${OWNCLOUD_TEST_CLASS_LOWERCASE}.cpp ${additional_cpp})
|
add_executable(${OWNCLOUD_TEST_CLASS}Test test${OWNCLOUD_TEST_CLASS_LOWERCASE}.cpp ${additional_cpp})
|
||||||
qt5_use_modules(${OWNCLOUD_TEST_CLASS}Test Test Sql Xml Network)
|
qt5_use_modules(${OWNCLOUD_TEST_CLASS}Test Test Sql Xml Network)
|
||||||
|
set_target_properties(${OWNCLOUD_TEST_CLASS}Test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY})
|
||||||
|
|
||||||
target_link_libraries(${OWNCLOUD_TEST_CLASS}Test
|
target_link_libraries(${OWNCLOUD_TEST_CLASS}Test
|
||||||
updater
|
updater
|
||||||
|
@ -40,6 +41,7 @@ macro(owncloud_add_benchmark test_class additional_cpp)
|
||||||
|
|
||||||
add_executable(${OWNCLOUD_TEST_CLASS}Bench benchmarks/bench${OWNCLOUD_TEST_CLASS_LOWERCASE}.cpp ${additional_cpp})
|
add_executable(${OWNCLOUD_TEST_CLASS}Bench benchmarks/bench${OWNCLOUD_TEST_CLASS_LOWERCASE}.cpp ${additional_cpp})
|
||||||
qt5_use_modules(${OWNCLOUD_TEST_CLASS}Bench Test Sql Xml Network)
|
qt5_use_modules(${OWNCLOUD_TEST_CLASS}Bench Test Sql Xml Network)
|
||||||
|
set_target_properties(${OWNCLOUD_TEST_CLASS}Bench PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY})
|
||||||
|
|
||||||
target_link_libraries(${OWNCLOUD_TEST_CLASS}Bench
|
target_link_libraries(${OWNCLOUD_TEST_CLASS}Bench
|
||||||
updater
|
updater
|
||||||
|
|
|
@ -345,7 +345,7 @@ public:
|
||||||
} else
|
} else
|
||||||
xml.writeEmptyElement(davUri, QStringLiteral("resourcetype"));
|
xml.writeEmptyElement(davUri, QStringLiteral("resourcetype"));
|
||||||
|
|
||||||
auto gmtDate = fileInfo.lastModified.toTimeZone(QTimeZone("GMT"));
|
auto gmtDate = fileInfo.lastModified.toTimeZone(QTimeZone(0));
|
||||||
auto stringDate = gmtDate.toString("ddd, dd MMM yyyy HH:mm:ss 'GMT'");
|
auto stringDate = gmtDate.toString("ddd, dd MMM yyyy HH:mm:ss 'GMT'");
|
||||||
xml.writeTextElement(davUri, QStringLiteral("getlastmodified"), stringDate);
|
xml.writeTextElement(davUri, QStringLiteral("getlastmodified"), stringDate);
|
||||||
xml.writeTextElement(davUri, QStringLiteral("getcontentlength"), QString::number(fileInfo.size));
|
xml.writeTextElement(davUri, QStringLiteral("getcontentlength"), QString::number(fileInfo.size));
|
||||||
|
|
|
@ -55,7 +55,6 @@ using namespace OCC;
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void initTestCase() {
|
void initTestCase() {
|
||||||
qDebug() << Q_FUNC_INFO;
|
|
||||||
_root = QDir::tempPath() + "/" + "test_" + QString::number(qrand());
|
_root = QDir::tempPath() + "/" + "test_" + QString::number(qrand());
|
||||||
QDir rootDir(_root);
|
QDir rootDir(_root);
|
||||||
|
|
||||||
|
@ -65,7 +64,9 @@ using namespace OCC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testUploadChecksummingAdler() {
|
void testUploadChecksummingAdler() {
|
||||||
|
#ifndef ZLIB_FOUND
|
||||||
|
QSKIP("ZLIB not found.", SkipSingle);
|
||||||
|
#else
|
||||||
ComputeChecksum *vali = new ComputeChecksum(this);
|
ComputeChecksum *vali = new ComputeChecksum(this);
|
||||||
_expectedType = "Adler32";
|
_expectedType = "Adler32";
|
||||||
vali->setChecksumType(_expectedType);
|
vali->setChecksumType(_expectedType);
|
||||||
|
@ -81,6 +82,7 @@ using namespace OCC;
|
||||||
loop.exec();
|
loop.exec();
|
||||||
|
|
||||||
delete vali;
|
delete vali;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void testUploadChecksummingMd5() {
|
void testUploadChecksummingMd5() {
|
||||||
|
@ -119,7 +121,9 @@ using namespace OCC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testDownloadChecksummingAdler() {
|
void testDownloadChecksummingAdler() {
|
||||||
|
#ifndef ZLIB_FOUND
|
||||||
|
QSKIP("ZLIB not found.", SkipSingle);
|
||||||
|
#else
|
||||||
QByteArray adler = checkSumAdlerC;
|
QByteArray adler = checkSumAdlerC;
|
||||||
adler.append(":");
|
adler.append(":");
|
||||||
adler.append(FileSystem::calcAdler32( _testfile ));
|
adler.append(FileSystem::calcAdler32( _testfile ));
|
||||||
|
@ -143,6 +147,7 @@ using namespace OCC;
|
||||||
QTRY_VERIFY(_errorSeen);
|
QTRY_VERIFY(_errorSeen);
|
||||||
|
|
||||||
delete vali;
|
delete vali;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue