Commit Graph

16 Commits

Author SHA1 Message Date
David Faure
4a11611c8a Fix unittest for QStandardPaths::enableTestMode
It was confusing DataLocation and GenericDataLocation, and the same
for CacheLocation and GenericCacheLocation. The test was passing in
the api_changes branch because these were giving the same result
(empty app name), but the QCoreApplication::applicationName fix in master
makes these different, so the bug in the test showed up after merging.

Change-Id: I80ef6883c96cfd02b8c277d9d686717028d396bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-05 10:15:21 +02:00
David Faure
a5a80da223 Allow auto tests to stay away from the user's configuration.
QStandardPaths now knows a "test mode" which changes writable locations
to point to test directories, in order to prevent auto tests from reading from
or writing to the current user's configuration.

This affects the locations into which test programs might write files:
GenericDataLocation, DataLocation, ConfigLocation,
GenericCacheLocation, CacheLocation.
Other locations are not affected.

Change-Id: I29606c2e74714360edd871a8c387a5c1ef7d1f54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-03-28 11:22:11 +02:00
David Faure
5ec5ce3549 Return all expected paths in QStandardPaths::standardLocations
ApplicationsLocation and DataLocation were returning only the local path,
rather than system paths + local path.

Change-Id: I653d14e5bbe1e08c5fa1ecd5a6106336d1cd0369
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-22 13:29:27 +01:00
Kurt Korbatits
805d895978 Fixed qstandardpaths unittest to handle being run as root
- testCustomRuntimeDirectory test skips if run as root

Change-Id: Idcc2a1db5d8a96b2ec0248b8b1c392fffc0b2e11
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 06:53:10 +01:00
Kurt Korbatits
c0dd519f88 Fixed qstandardpaths unittest to check before using first()
- Added check to testLocateAll() to check count() before calling
  first().

Change-Id: I04e93c1f913972b26c517f2bbd08760f9898cc7a
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-31 04:24:04 +01:00
Jason McDonald
5635823e17 Remove "All rights reserved" line from license headers.
As in the past, to avoid rewriting various autotests that contain
line-number information, an extra blank line has been inserted at the
end of the license text to ensure that this commit does not change the
total number of lines in the license header.

Change-Id: I311e001373776812699d6efc045b5f742890c689
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-30 03:54:59 +01:00
Jason McDonald
629d6eda5c Update contact information in license headers.
Replace Nokia contact email address with Qt Project website.

Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-23 04:04:33 +01:00
Jason McDonald
1fdfc2abfe Update copyright year in license headers.
Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 06:36:56 +01:00
Jason McDonald
e3640d1bdd Remove TESTED_CLASS/TESTED_FILES comments from tests.
These comments were mostly empty or inaccurate.  Appropriate naming of
tests and appropriate placement of tests within the directory tree
provide more reliable indicators of what is being tested.

Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-06 02:19:25 +01:00
Rohan McGovern
3385fb91e1 Fixed installation of corelib tests
In .pro files, removed wince/symbian-specific DEPLOYMENT cases and
replaced them with TESTDATA where appropriate.

In .cpp files, removed SRCDIR and relative paths to testdata and
replaced them with the QFINDTESTDATA macro where appropriate.

Modified test helper apps/libs to install themselves under the test
they relate to.

This change allows corelib tests to be correctly installed, along with
their testdata, via `make install'.

Change-Id: I5e202e2f3b577af7e39072d5c9fe13e0ca125304
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-01 09:12:52 +01:00
Jason McDonald
578e6d6834 Cleanup corelib autotests
Remove various disabled and/or non-helpful debugging code.

Any test diagnostics that are useful should be part of the regular test
output, as the CI system cannot switch on commented-out code when there
is a test failure.  Diagnostics should also be informative -- simply
printing the value of a variable with no other information about what is
being printed (or why it is being printed) is not informative.

Change-Id: I21a6c2121be86001bb57e80f426507b6e619ee9e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-14 07:33:57 +01:00
Jason McDonald
94fc875079 Cleanup corelib autotests
Tidy the autotest .pro files.  Most autotest .pro files should look like
this:

CONFIG += testcase
TARGET = tst_something
QT = core testlib
SOURCES = tst_something.cpp

Change-Id: I877c2194e9fa9dd13478d117895e1e255a948ad7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-11 02:45:05 +01:00
Jason McDonald
e8f7fccf22 Cleanup corelib autotests
Remove redundant empty constructors, destructors and test functions.

Change-Id: Idb51368895e67ec3fc0345a9a5d33d77730c051b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-07 13:26:41 +01:00
David Faure
272d20ce27 QStandardPaths: add DownloadLocation.
Only properly implemented on unix (XDG), falls back to Document location
on Mac and Windows, because not easily available with the current API
being used by either one.

Change-Id: Id269f0e3c4e3a68e19205de96c0b39980fde80ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-04 10:54:54 +01:00
David Faure
ae6e7e3d59 Fix tst_qstandardpaths: Mac OSX is a unix, but doesn't use XDG.
Change-Id: I2b4552a162dc9f993e0587ace6e7e3fb4f96571e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-04 10:53:41 +01:00
David Faure
03fd37cdf4 Add the missing unittest
Change-Id: I2384d9de7b9ef409db521087670070bd5afc85ff
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-23 00:57:10 +02:00