is not installed, running
perl ../bin/TestRunner.pl InitFormTests.pm
throws very noisy errors instead of just warning that the tests can not be run. This is distracting when I run the whole
Why didn't you just install HTML::TreeBuilder?
tests that just tell you they can't be run. It just gives people an excuse to ignore the test. To me, that's a test failure. Looking at the code for this test, it does
bottle out if HTML::TreeBuilder isn't installed, which IMHO is wrong
If that bugs you, why not recode the test to eliminate HTML::TreeBuilder? From glancing at those tests, they should be recoded to use
anyway, which is tolerant to changing parameter orders in HTML tags.
To be honest: Before I ran the tests on one of my systems, I would have sworn that I have
installed, because I use to have it in all my installations.
returns undef if
isn't installed, but
ignores that. This gives an error message for every test in the summary, which is anything but helpful:
1) /home/haj/public_html/TWikiRelease04x00/test/unit/InitFormTests.pm:152 - test_form(InitFormTests)
Can't call method "content_list" on an undefined value
I'll hack around this to produce a better message for now (and therefore setting to "Actioning").
But there's another gotcha lurking, which deserves a Codev brainstorming. When the tests failed, it occurred to me that TWiki's unit test mechanism lacks a decent way to cope with missing "non-TWiki" CPAN libraries in general. What if I'd like to use
for a particular unit test? But should I insist on every tester installing it?
I seem to be unable to eliminate
, so the current checkin just improves the diagnostics. Back to "Waiting for Feedback".
Guys, writing test cases is hard enough. Let me at least use something to make my life easier.
It is not very hard to install HTML::TreeBuilder. Anybody who can run test suites can do so, I think. It sure is easier to dissect the HTML that way. I am willing to rewrite if we use another HTML parser, but I am not going to do this all with regexes. -- TW
I'm inclined to agree. If we start imposing too many constraints, we will never
get people to write tests; it's hard enough already!
Discarding for that reason.
Fair enough. I never intended to impose a constraint. But please don't rollback r11677, because with better diagnostics we will probably get people to actually run
the tests before doing their checkins.