simonm has asked for the wisdom of the Perl Monks concerning the following question:

I'm working on an updated release of my Class::MakeMethods module and am unsure of how I can fix the errors reported by Win32 smoke testers:

NMAKE : fatal error U1095: expanded command line 'C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t\attribute_stnd_hash.t t\autoload_stnd_hash.t (other test scripts...) t\utility_inheritable.t' too long
Stop.

Ouch. It's true that this distribution includes a lot of test scripts, but of course Windows is the only platform to fail. The failing command line is a little over 2KB, so I suppose I'm running into the ShellExecute INTERNET_MAX_URL_LENGTH limit I found discussed here.

I had previously split the tests up into subdirectories but ran into a different set of Windows command-shell issues; I found a workaround that I hoped might fix this in this release (have a test that runs all the tests in a subdirectory) but I'm unsure if that works on Windows because it was masked by this other failure... Grr.

Does anyone have any other suggestions or workarounds to consider before I go off renaming the test scripts to have shorter filenames and/or merging them into fewer files? Will I be safe once I get the length of the command line down to a bit under 2KB or are there other limits to watch out for?

  • Comment on Too many tests for Windows command line?

Replies are listed 'Best First'.
Re: Too many tests for Windows command line?
by BrowserUk (Patriarch) on Sep 02, 2004 at 21:46 UTC

    You could try globbing @ARGV in a begin block:

    perl -e"BEGIN{ @ARGV=map glob, @ARGV }" -le"print for @ARGV" t\*.t

    If the shell has already expanded the file arguments then the glob will have no effect, but on win32 it will expand it.

    perl's glob will also expand wild cards in the paths so things like:

    perl -le"BEGIN{ @ARGV= map glob, @ARGV}" -e"print for @ARGV" t/*/*.t

    Become possible should you want to structure your test directory beyond one level.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
Re: Too many tests for Windows command line?
by PodMaster (Abbot) on Sep 03, 2004 at 05:17 UTC
    Why haven't you done what I suggested?

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Why haven't you done what I suggested?

      I tried it at first but ran into problems and gave up.

      After some further examination I realized that the key to getting it working was to just drop in the test.pl and rename the "t/" directory, but NOT add the test => { TESTS => 'test.pl' } part to the Makefile.PL.

      I integrated this with a few other suggestions from chromatic and BrowserUK to come up with the following, which seems to work well under Unix, and I'm hopeful that it'll also solve my Win32 issues.

      Thanks for everyone's help with this; feedback on this code or any additional suggestions would be welcome.

Re: Too many tests for Windows command line?
by Anonymous Monk on Sep 03, 2004 at 19:56 UTC

    please browse the rt.cpan.org archive of ExtUtils::MakeMakers. There you will find a comprehensive discussion on this very issue with Schwern.

    Its all related to ExtUtils::MakeMakers version and/or nmake version.

    Murat
Re: Too many tests for Windows command line?
by Anonymous Monk on Sep 03, 2004 at 19:19 UTC
    In non-NT derived Windows Versions the Commandline is max 127 char plus EOL