chromatic wrote:
On Friday 11 January 2008 16:44:58 [EMAIL PROTECTED] wrote:


Log:
auto::msvc:  Refactored some code to increase testability:
_handle_not_msvc().  Add 113-auto_msvc-04.t to test this internal
subroutine. In 113-auto_msvc-01.t, SKIP only test for runstep() on
non-Win32 platforms. Small corrections in other test files.

I don't understand this. What's the value of testing any part of this code on non-Windows platforms? It doesn't (and can't) tell us anything interesting about our configuration system.

I can't speak for others but it tells me something interesting about auto::msvc. It tells me that the code is sound and thorough Perl 5 notwithstanding the fact that I don't have a Windows box on which to build and test Parrot.

The configuration step classes have a considerable amount of code which is specific to a particular operating system, platform (chip), C compiler or any combination thereof. Some of the time this is broken out into focused subclasses (init::hints::{OS}; auto::cpu::{platform}::auto; etc.). Most of the time it is found inside a particular config step class's runstep() routine. As we have previously discussed, this makes thorough testing difficult, because a given human tester has only a limited number of OSes, platforms and C compilers available.

We can overcome this difficulty to a considerable extent by refactoring that mocks the conditions found on various OS/platform/compiler combinations. Even if we're not on a Windows box, we can write tests that ask, "Suppose that we were on Windows and were provided with information as to whether we had a VC++ compiler or not. Is the code which uses that information sound? Have we considered what happens at all diversion points in the control flow after we have received that information? If we were on Windows, would our tests exercise every nook and cranny of the code?"

And that's what these tests do. The fact that they achieve high test coverage of auto::msvc (http://thenceforward.net/parrot/coverage/configure-build/config-auto-msvc-pm.html) when run on a non-Windows system gives me considerable confidence that auto::msvc will do the right thing when run on Windows. It also gives anyone in the future doing refactoring on auto::msvc a framework with which to test the soundness of that refactoring.

kid51

Reply via email to