[Development] date/time adjust for (auto) testing
Florian Bruhin
me at the-compiler.org
Wed Jun 3 09:04:56 CEST 2015
* André Somers <andre at familiesomers.nl> [2015-06-03 08:38:48 +0200]:
> We have applications that use the current date and time at places spread
> around the code. For normal operations, that works very nicely. However,
> we find that for (auto) testing, it would be very convenient if we could
> trick the application into believing it is some other date/time, so that
> we can test if certain behaviours work the way we would like to
> automatically. Currently, these tests take a lot of time because we
> actually need to manually adjust the system date and time, do some
> stuff, then adjust again, etc.
>
> It would be really confortable if there was some control to set a
> date/time offset (so the time keeps running) or a fixed date/time to be
> returned from currentDate(), currentTime() or currentDateTime()
> respectively. I guess access to such a thing does not belong in the main
> Qt classes, but is really a testing tool, so perhaps it could find
> refuge in QtTest somewhere. Would a contribution adding such a thing
> stand any chance of being accepted, or would this be considered out of
> scope or even unwanted?
FWIW there's libfaketime[1] which might be some inspiration - but
that's Linux/OS X only.
[1] https://github.com/wolfcw/libfaketime
Florian
--
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150603/2b8acdd7/attachment.sig>
More information about the Development
mailing list