On Mon 10 Sep 2001 15:15, "Mattia Barbon" <[EMAIL PROTECTED]> wrote:
> Hello,
> I downloaded Test::Smoke 1.06, and it does not support smoking
> on Win32.
> Attached there is a patch _for discussion_ ( incomplete,
> does only support dmake + MSVC5 ), and an example smoke.
I've implemented most of it for 1.08 after some twiddling, reordering and
reformatting. Thanks again for the time and effort (also for Patrrot BTW)
Not that I agree with all, but gaining more smoke power is valued over full
coverage (I'm trying to build blead with both DJGPP (bad things happen) and
Cygwin (96% pass on make miniperl), and neither would pass the "dmake", since
I don't have it)
> Discussion about some parts of the patch:
> diff -b -u -r Test-Smoke-1.06.orig/mktest.pl Test-Smoke-
> 1.06/mktest.pl
> --- Test-Smoke-1.06.orig/mktest.pl Mon Sep 03 12:32:57 2001
> +++ Test-Smoke-1.06/mktest.pl Sun Sep 09 00:43:10 2001
> @@ -43,6 +44,26 @@
> return qx($command);
> } # run
>
> +sub make ($) {
> + my $cmd = shift;
> +
> + if( is_win32() ) {
> + my( $kill_err );
> + # don't capture STDERR
> + $cmd =~ s{2\s*>\s*/dev/null\s*$}{} and $kill_err = 1;
> + $cmd = 'dmake -f smoke.mk ' . $cmd;
> + chdir 'win32' or die "unable to chdir() into 'win32'";
> + if( $kill_err ) {
> + run qq{$^X -e "close STDERR;system '$cmd'"};
> + } else {
> + run $cmd;
> + }
> + chdir '..' or die "unable to chdir() out of 'win32'";
> + } else {
> + run "make $cmd";
> + }
> +}
in as
sub make ($)
{
my $cmd = shift;
is_win32 () or return run ("make $cmd");
my $kill_err;
# don't capture STDERR
$cmd =~ s{2\s*>\s*/dev/null\s*$}{} and $kill_err = 1;
# Better detection of make vs. nmake vs. dmake required here
# dmake + MSVC5, make + DJGPP, make + Cygwin
$cmd = "dmake -f smoke.mk $cmd";
chdir "win32" or die "unable to chdir () into 'win32'";
run ($kill_err ? qq{$^X -e "close STDERR; system '$cmd'"} : $cmd);
chdir ".." or die "unable to chdir() out of 'win32'";
} #make
> called as 'make "test";' or 'make "foo 2>/dev/null";'
> Win32 makefiles reside
> in the win32/ subdir. This code tries to handle 2>/dev/null,
> but it is probably better to have something like
> make 'target',
> 'STDERR' => 'STDOUT',
> 'STDOUT' => '/dev/null';
> ( suggestions welcome )
> print TTY "\nConfigure ...";
> - run "./Configure $config_args -des";
> + run "./Configure $config_args -des",
> + is_win32() ? \&Configure : undef;
>
> See below for discussion about this.
>
> - unless ($norun or (-f "Makefile" && -s "config.sh")) {
> + unless ($norun or ( is_win32() ?
> + -f 'win32/smoke.mk' :
> + -f "Makefile" && -s "config.sh")) {
Does dmake/MSVC5 *not* create config.sh ???
> - unless ($norun or (-s "perl" && -x _)) {
> + use Config;
> + my $perl = "perl$Config{_exe}";
> + unless ($norun or (-s $perl && -x _)) {
Good catch!
> Some obvious win32 compability
>
> @@ -339,10 +376,16 @@
> if (@harness) {
> local $ENV{PERL_SKIP_TTY_TEST} = 1;
> print TTY "\nExtending failures with Harness\n";
> + my $harness = is_win32() ?
> + join ' ', map { s{^\.\.[/\\]}{};
> + m/^(?:lib|ext)/ and $_ =
> "../$_";
> + $_ } @harness :
> + "@harness";
>
> On win32 all text results point to ../somedir/sometext,
> however for harness to work properly, tests in
> lib/ and ext/ need to be prefixed with ../, while
> the ones in t/ must not.
Hrmmm, OK, but you forgot the obvious
push @nok, "\n",
grep !m:\bFAILED tests\b: &&
- !m:% okay$: => run "./perl t/harness @harness";
+ !m:% okay$: => run "./perl t/harness $harness";
> The sub below takes a ./Configure command line and makes some
> modifications to win32/makefile.mk, writing them to smoke.mk
>
> +
> +sub Configure {
> :
> Comments?
Yep, how/where is this called? Should it need another option?
Just defining a sub won't make it called ;)
> diff -b -u -r Test-Smoke-1.06.orig/mkovz.pl Test-Smoke-1.06/mkovz.pl
> --- Test-Smoke-1.06.orig/mkovz.pl Mon Sep 03 12:32:50 2001
> +++ Test-Smoke-1.06/mkovz.pl Sun Sep 09 00:02:17 2001
Sensible patch.
> On win32 I found some of that in 'make test' output
> ..\lib/File/Find/t/taint..............dubious
> Test returned status 1 (wstat 256, 0x100)
> DIED. FAILED test 28
> Failed 1/45 tests, 97.78% okay (-18 skipped tests: 26 okay, 57.78%)
>
> and this ends up as
> DIED. FAILED test 28
> in mktest.rpt, without any mention of the test script
> so if I ges a "DIED" or "FAILED" at the beginning of the line,
> I look back the last 5 lines for something containing '..'
> ( the line with the test name )
Do you want to peruse/test the new set before I make it world available?
Where do you want to /create/ the win32 subfolder /if/ in win32? During
Makefile.PL?
--
H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
using perl-5.6.1, 5.7.1 & 629 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
WinNT 4, Win2K pro & WinCE 2.11. Smoking perl CORE: [EMAIL PROTECTED]
http:[EMAIL PROTECTED]/ [EMAIL PROTECTED]
send smoke reports to: [EMAIL PROTECTED], QA: http://qa.perl.org