When running
PluginHandlerTests
, every testcase fails with:
/bin/cp: cannot stat ‘/media/haj/linuxdevel/twiki/trunk/core/data/TWiki/{WebPreferences,TWikiPreferences}.txt’: No such file or directory
Maybe some operating systems have a
cp
command which evaluates
{WebPreferences,TWikiPreferences}
as a list, but Ubuntu doesn't.
The shell commands have been added for
Item6870 as a fix to the symptom that unit tests fail to copy the
TWiki
web. Ouch. I just reported that in
Item7523.
Unfortunately, the fix only treats the symptom and not the root cause, and it doesn't work for me.
The idea to have a "minimal" copy of the
TWiki
web for test purposes is quite fine, but I suggest that the implementation abandons the
system
call.
- Minimal improvement: Use
File::Copy
instead of bin/cp
and use an explicit loop over the files needed instead of non-portable shell syntax.
- Better: Have a unit test utility function which copies the relevant parts of the
TWiki
web. According to Item6870 quite a couple of test cases want to do this, so it is a candidate for factoring into TWikiTestCase.pm
.
I'm currently going through the unit tests alphabetically, but from the SVN reports I assume that the same problem will hit me with
PrefsTests
and
RegisterTests
, too.
--
TWiki:Main/HaraldJoerg
- 2014-06-22
Ok, this patch is too long for a comment - it is attached (%ATTACHURL%/item7525.patch). In addition to
PluginHandlerTests
,
PrefsTests
and
RegisterTests
it also covers
EmptyTests
, so that
Item7523 can no longer be tested by using the example code.
--
TWiki:Main.HaraldJoerg
- 2014-06-23