Commit graph

47 commits

Author SHA1 Message Date
Olivier Goffart
766d9ae1ac QProgressIndicator: update copy from upstream
Update from commit 05ce8a23cdc12e825532dc6de06c267fb8d48b4f from
https://github.com/dragotin/QProgressIndicator
Which itself is forked from commit e5ba0fd09bfd43b067ee3646d70b294c7efcb558 from
upstream, with additional license header.

It was relicensed to MIT according to
14bb9d10e2

Relates to issues #5180 and #5184
2016-10-13 12:05:59 +02:00
Jocelyn Turcotte
b28123bed9 Fix the Qt4 unit testing build 2016-08-18 10:34:07 +02:00
Jocelyn Turcotte
b7ff4a76e8 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.
2016-08-17 15:39:30 +02:00
ckamm
e6b937f508 LockWatcher: Keep an eye on Windows file locks (#4758)
When a conflict-rename or a temporary-rename fails, notify the
LockWatcher. It'll regularly check whether the file has become
accesible again. When it has, another sync is triggered.

owncloud/enterprise#1288
2016-04-29 16:14:18 +02:00
Daniel Molkentin
e29d7e0128 Use QTokenizer to properly parse netrc
Addresses #4691
2016-04-21 12:46:03 +02:00
Christian Kamm
844777d43f Fix unit test build 2016-04-12 13:43:17 +02:00
Jocelyn Turcotte
f427955512 Simplify the build of auto tests
Remove all configure_files:
- Move all tests to cpp files
- Use the QTEST_MAIN macro instead of a generated main.cpp
- Include test*.moc in the cpp to let CMAKE_AUTOMOC call moc
- Pass info through add_definitions instead of generating oc_bin.h with them

This makes sure that build errors points to the original test source
file instead of the generated one in the build directory to be able to
jump and fix errors directly from the IDE's error pane.
2016-03-30 18:00:22 +02:00
Christian Kamm
10db6cee6c Rename files 2015-11-23 12:09:25 +01:00
Markus Goetz
a6c9e8c5b4 Merge branch 'kill_legacy_propagator' 2015-10-28 11:06:50 +01:00
Olivier Goffart
455c3ae57d test/CMakeLists.txt: remove comments 2015-10-22 12:32:53 +02:00
Markus Goetz
c8590c4468 Remove legacy propagator and neon
The code was already uneeded/unbuilt on Windows and OS X.
2015-10-20 17:57:43 +02:00
Christian Kamm
225da68832 ExcludedFiles: Add test 2015-10-13 15:01:59 +02:00
Jocelyn Turcotte
94a57fe8d5 Get rid of ShibbolethRefresher
This is only for neon and not necessary if we want to show a notification
instead of a login window when the network reports invalid credentials.
2015-09-05 15:45:54 +02:00
Daniel Molkentin
72b2c52e15 Merge branch 'master' into linux_restart_on_new_version
Conflicts:
	src/gui/application.cpp
	src/gui/owncloudsetupwizard.cpp
2015-08-06 11:11:52 +02:00
Markus Goetz
ad9ef0493e FolderManTest: Make compile 2015-08-04 16:55:10 +02:00
Klaas Freitag
579e24be10 Tests: Make independent of an hardcoded path, rather use CMAKE_BINARY_DIR. 2015-07-31 15:28:31 +02:00
Jocelyn Turcotte
6d522a1467 Fix the tests build on OS X in debug 2015-07-28 15:19:09 +02:00
Olivier Goffart
4dbe0693df FolderMan::checkPathValidityForNewFolder
factorize the function to check the validity of a new folder out of
the folder wizard to the FolderMan.

There is even a test for it now.

That way we can also use it in the normal wizard
2015-07-13 14:35:19 +02:00
Klaas Freitag
830daa40d1 Add a class TransmissionChecksumValidator, incl. unit test.
This does all needed to manage checksums that go with http headers
ensuring that the transmission was correct.
2015-05-19 17:09:40 +02:00
Klaas Freitag
823f9fa0d1 Checksum Calculation: Add unit test. 2015-05-19 17:09:39 +02:00
Klaas Freitag
d2bae21b14 Added unit test for XML Parser class. 2015-04-14 13:43:05 +02:00
Christian Kamm
40dbc78407 concatUrl: Remove manual parsing, add test. #2817 2015-02-13 14:53:55 +01:00
Olivier Goffart
b9161aa06c libsync: Fix a case in which canceling the sync would result in some folder never being sync'ed
The problem occurs because of the sorting of items when we have things like

bigfolder
bigfolder/bigsubfolder
bigfolder-2

Then, because dashes come before slash in ascii, the bigfolder-2 would come before its content
and the propagator would thinkg bigfolder is empty and save the etag before it is processed

Should fix issue #2832
2015-02-12 20:00:04 +01:00
Christian Kamm
4d7b8bdb25 Merge remote-tracking branch 'origin/1.7'
Conflicts:
	OWNCLOUD.cmake
	test/CMakeLists.txt
	test/testfolderwatcher.h
2014-11-19 14:45:25 +01:00
Christian Kamm
421a8cc6b7 Windows: Make unit tests compile. 2014-11-19 14:18:37 +01:00
Daniel Molkentin
dc1e73dcb7 Merge remote-tracking branch 'origin/1.7'
Conflicts:
	src/libsync/syncjournaldb.cpp
	test/CMakeLists.txt
2014-10-28 23:27:58 -04:00
Christian Kamm
e5269a4151 Add SyncJournalDB autotests.
There also was a bug in syncjournaldb: in some error conditions the
sql query wasn't reset properly. We now always reset a query before
calling bindValue.
2014-10-23 15:15:47 +02:00
Christian Kamm
7ae0338f5c Merge remote-tracking branch 'origin/1.7'
Conflicts:
	src/CMakeLists.txt
	src/cmd/cmd.cpp
	src/gui/socketapi.h
	src/libsync/syncengine.h
	test/CMakeLists.txt
2014-10-22 10:41:55 +02:00
Klaas Freitag
0094c1ecf5 Make the sync work with new sql implementation. 2014-10-14 20:51:51 +02:00
Olivier Goffart
d7d241196e tests: add the source dir in the include paths 2014-09-22 08:58:35 +02:00
Olivier Goffart
eab488e64f compile after merge 2014-09-18 19:58:04 +02:00
Olivier Goffart
50e718b1e7 Merge branch '1.7'
Conflicts:
	src/CMakeLists.txt
	src/cmd/cmd.cpp
	src/gui/folder.cpp
	src/gui/socketapi.cpp
	translations/mirall_ca.ts
	translations/mirall_cs.ts
	translations/mirall_de.ts
	translations/mirall_el.ts
	translations/mirall_en.ts
	translations/mirall_es.ts
	translations/mirall_es_AR.ts
	translations/mirall_et.ts
	translations/mirall_eu.ts
	translations/mirall_fa.ts
	translations/mirall_fi.ts
	translations/mirall_fr.ts
	translations/mirall_gl.ts
	translations/mirall_hu.ts
	translations/mirall_it.ts
	translations/mirall_ja.ts
	translations/mirall_nl.ts
	translations/mirall_pl.ts
	translations/mirall_pt.ts
	translations/mirall_pt_BR.ts
	translations/mirall_ru.ts
	translations/mirall_sk.ts
	translations/mirall_sl.ts
	translations/mirall_sv.ts
	translations/mirall_th.ts
	translations/mirall_tr.ts
	translations/mirall_uk.ts
	translations/mirall_zh_CN.ts
	translations/mirall_zh_TW.ts
2014-09-18 17:10:21 +02:00
Daniel Molkentin
fe023e2229 Allow passing user/pass explicitly or via netrc
#2211
2014-09-16 23:52:28 +02:00
Daniel Molkentin
2c6324e3e5 Fix tests 2014-08-27 10:27:29 +02:00
Olivier Goffart
45d1567057 Move Folder, FolderMan, and FolderWatcher outside of owncloudsync
Those class are maintaining the folder for the mirall configuration
They are not usefull in command line clients

Also the FolderWatcher is only used by the folder and not used by the
command line clients
2014-07-09 22:44:08 +02:00
Klaas Freitag
39924d79cb Add new test to test the csync database code. 2014-03-20 11:15:28 +01:00
Daniel Molkentin
1aa050bea9 Add Tests, make Updater classes into a static lib 2014-01-29 10:43:21 +01:00
Klaas Freitag
3d6718315c Fix Include dirs and add tests. 2014-01-23 13:23:27 +01:00
Klaas Freitag
e5804b5d12 Use a more Qt'ish folder recursing method, remove unused class.
Added unit test.
2014-01-08 14:36:42 +01:00
Olivier Goffart
0589bfc51b Merge branch 'master' into propagator-ng
This just fix the conflict.
Do not compile or work yet

Conflicts:
	src/CMakeLists.txt
	src/mirall/csyncthread.cpp
	src/mirall/csyncthread.h
	src/mirall/owncloudfolder.cpp
	src/mirall/syncfileitem.h
	test/CMakeLists.txt
2013-08-14 15:19:21 +02:00
Daniel Molkentin
60a116f3e0 Add tests for Utility namespace 2013-08-09 12:56:43 +02:00
Klaas Freitag
ba01a697e6 Renamed test case to get rid of stinking name. 2013-08-05 09:39:06 +02:00
Klaas Freitag
946258ca59 Created a test file for ownCloudPropagator. Not much in yet. 2013-05-05 12:36:42 +02:00
Dominik Schmidt
351f9aedfb Add testing skeleton 2012-10-26 20:24:12 +02:00
Duncan Mac-Vicar P
f22caca96b - refactor tests repeat-myself with a cmake macro
- enable cmake testing
2011-03-31 20:26:51 +02:00
Duncan Mac-Vicar P
bad489adcc add testcases for unison 2011-03-30 23:36:30 +02:00
Duncan Mac-Vicar P
e6a135273d - introduce a tmp dir class and rm-rf util function
- start a testcase for the folder watcher part
2011-03-18 01:14:45 +01:00