[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] wx_test cleanup
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] wx_test cleanup |
Date: |
Wed, 29 Oct 2014 16:01:34 +0100 |
On Wed, 29 Oct 2014 12:05:15 +0000 Greg Chicares <address@hidden> wrote:
GC> I anticipate running 'wx_test' frequently--perhaps before every
GC> commit--which makes the following side effects inconvenient; can
GC> they be suppressed?
They can, of course. I'm just not sure when should this be done:
(a) Always?
(b) Only if all tests pass?
(c) If some specific command line option is [not] given?
I don't think (a) is a good idea because I think these files could be
useful for diagnosing the problem if the test fails. In principle, (b)
should be fine, but perhaps [sometimes?] the person running the tests would
need to have a look at the outputs to verify something not checked
automatically? In this case (c) seems like the best choice.
GC> (1) It creates at least eighteen files in /opt/lmi/bin where I
GC> run it. That's how the program normally behaves, so that's how
GC> the tests should work: it'd probably be a bad idea to test in
GC> a different directory. Therefore, wouldn't it be best to delete
GC> them when the test is finished?
Here the only problem is when to do it, i.e. which of (a), (b) and (c)
above do you prefer.
GC> (2) Apparently 'configurable_settings.xml' is modified.
This is unexpected, I don't think we intentionally modify it anywhere.
Could you please tell me what exactly is changed if you already know it?
GC> Would it make sense for 'wx_test' to rename it at the start, then
GC> rename it back at the end?
I'll do this if the modifications should be done in the first place.
GC> (3) File history also changes. Is there any way to save the
GC> original values before the test, and restore them afterward?
We could do it like this, but a simpler solution would be to just avoid
saving the history into wxConfig when testing. This can be done entirely
outside of the normal program code by clearing the history in
SkeletonTest::OnExit() before calling the base class version, as the call
to FileHistorySave() in it then wouldn't have any effect.
It's not as robust as saving wxConfig contents before starting the test
and restoring it when it ends, but as long as FileHistorySave() is only
called from Skeleton::OnExit(), it works just as well and is much simpler.
Do you have any objections to doing it like this?
Thanks,
VZ