From b7ff4a76e8643d6a23c9f36b4f3e4e0cf7373867 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 4 Aug 2016 14:59:46 +0200 Subject: Add TestSyncEngine and TestSyncFileStatusTracker auto tests To be able to test the SyncEngine efficiently, a set of server mocking classes have been implemented on top of QNetworkAccessManager. The local disk side hasn't been mocked since this would require adding a large abstraction layer in csync. The SyncEngine is instead pointed to a different temporary dir in each test and we test by interacting with files in this directory instead. The FakeFolder object wraps the SyncEngine with those abstractions and allow controlling the local files, and the fake remote state through the FileModifier interface, using a FileInfo tree structure for the remote-side implementation as well as feeding and comparing the states on both side in tests. Tests run fast and require no setup to be run, but each server feature that we want to test on the client side needs to be implemented in this fake objects library. For example, the OC-FileId header isn't set as of this commit, and we can't test the file move logic properly without implementing it first. The TestSyncFileStatusTracker tests already contain a few QEXPECT_FAIL for what I esteem being issues that need to be fixed in order to catch up on our test coverage without making this patch too huge. --- test/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/CMakeLists.txt') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f701700aa..40c964991 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -42,6 +42,10 @@ owncloud_add_test(FileSystem "") owncloud_add_test(ChecksumValidator "") owncloud_add_test(ExcludedFiles "") +if(NOT BUILD_WITH_QT4) + owncloud_add_test(SyncEngine "syncenginetestutils.h") + owncloud_add_test(SyncFileStatusTracker "syncenginetestutils.h") +endif(NOT BUILD_WITH_QT4) SET(FolderMan_SRC ../src/gui/folderman.cpp) list(APPEND FolderMan_SRC ../src/gui/folder.cpp ) -- cgit v1.2.3