When faced with this situation, in practice I do "cpan -t $module"
followed by "cpan -fi $module". So I do test, but this is still
not a real solution: it tests one build of the module and then
force-installs a separate build. If the build process is the slightest
bit non-deterministic, it may end up installing a broken build. Also,
as the building and testing happen separately for the two builds, this
is much slower than a single operation.
What I want is a more specific "force" flag. Rather than forcing
everything, I only want to override the check for the module already
being installed. I don't want to ignore the tests, or to force anything
else that is (or might be) controlled by the generic "force" modifier.
There ought to be similar more-specific force flags for each thing that
can be forced; it would generally be good practice to force only what
one specifically wants forced. So "cpan --force-reinstall $module" would
reinstall while paying attention to tests; "cpan --force-tests $module"
would install while ignoring test failures but not if the module is
already up to date.
Interestingly, it seems the reinstall behaviour is available in the
CPAN shell. "install $module" on its own won't reinstall, but if "test
$module" (which doesn't care about the module already being installed)
is done first then "install $module" will install from the same
build directory even if the module is already installed. This process
presumably respects test results. It can't be done from the command line,
though: "cpan -ti $module", which might have been expected to replicate
it, won't reinstall.
-zefram