Mailing List Archive

test.pl patch for h2xs and API
This patch closes a FH, and writes a stub (but working) test.pl. I
think this part should be mentioned in perlapi (what is the correct
spelling now?) together with t/*.t stuff.

Btw, almost unknown difference is that test.pl may be interactive, but
t/*.t are processed by the test engine.

Enjoy,
Ilya

*** h2xs.SH.orig Thu Nov 02 22:53:54 1995
--- h2xs.SH Sun Nov 12 19:13:34 1995
***************
*** 411,417 ****
--- 411,436 ----
print PL " 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' \n";
print PL " 'INC' => '', # e.g., '-I/usr/include/other' \n";
print PL ");\n";
+ close(PL) || die "Can't close $ext$modpname/Makefile.PL: $!\n";

+ warn "Writing $ext$modpname/test.pl\n";
+ open(EX, ">test.pl") || die "Can't create $ext$modpname/test.pl: $!\n";
+
+ print EX <<'_END_';
+ BEGIN {print "1..1\n";}
+ END {print "not ok 1\n" unless $loaded;}
+ _END_
+
+ print EX <<_END_;
+ use $module;
+ _END_
+
+ print EX <<'_END_';
+ $loaded = 1;
+ print "ok 1\n";
+ _END_
+
+ close(EX) || die "Can't close $ext$modpname/test.pl: $!\n";

system '/bin/ls > MANIFEST' or system 'ls > MANIFEST';
!NO!SUBS!
Re: test.pl patch for h2xs and API [ In reply to ]
> From: Ilya Zakharevich <ilya@math.ohio-state.edu>
>
> This patch closes a FH, and writes a stub (but working) test.pl.

Great idea.

Tim.