Permalink
Browse files

setup for python and allow explicit include list

  • Loading branch information...
ingydotnet committed Sep 15, 2010
1 parent 2dccb95 commit ef55d403bfa5c963649da6840c1cafc3b765172c
Showing with 16 additions and 3 deletions.
  1. +16 −3 lib/TestML/Setup.pm
View
@@ -13,6 +13,7 @@ my $template;
my $testml;
my $local;
my $lang;
my $include;
my $skip;
sub testml_setup {
@@ -30,7 +31,9 @@ sub testml_setup {
if (not -e $dest or -M $src < -M $dest) {
system("cp -f $src $dest") == 0
or die "copy $src to $dest failed";
if (@$include) {
next unless grep {$name eq $_} @$include;
}
next if grep {$name eq $_} @$skip;
my $filename = "$name.t";
print "Generating $filename\n";
@@ -53,8 +56,9 @@ sub init {
unless $config->{lang};
die "'lang' must be 'pm5' or 'pm6' in $config_file"
unless $config->{lang} =~ /^(pm5|pm6)$/;
($testml, $local, $lang, $skip) =
@{$config}{qw(testml local lang skip)};
($testml, $local, $lang, $include, $skip) =
@{$config}{qw(testml local lang include skip)};
$include ||= [];
$skip ||= [];
$config->{bridge} ||= '';
no strict 'refs';
@@ -81,6 +85,15 @@ TestML::Runner::TAP.new(
...
}
sub template_py {
return <<'...';
import sys; sys.path.insert(0, '.')
from testml.runner.pytest import TestML, test
TestML.document = '[% testml_dir %]/[% testml_file %]'
TestML.bridge = '[% bridge %]'
...
}
1;
=encoding utf-8

0 comments on commit ef55d40

Please sign in to comment.