--- messaging/manakai/bin/daf.pl 2006/03/16 08:52:31 1.6 +++ messaging/manakai/bin/daf.pl 2006/04/01 14:41:29 1.9 @@ -278,8 +278,6 @@ undef $DNi; undef %ModuleSourceDNLDocument; -undef $limpl; -undef $impl; exit $HasError if $HasError; ## --- Creating Files @@ -295,6 +293,8 @@ if ($out_type eq 'perl-pm') { status_msg_ qq for <$mod_for>...>; + local $Message::Util::DIS::Perl::Implementation + = $impl->get_feature (ExpandedURI q => '1.0'); my $pl = $mod->pl_generate_perl_module_file; status_msg qq; @@ -342,6 +342,9 @@ undef $db; status_msg "done"; +undef $limpl; +undef $impl; + { use integer; my $time = time - $start_time; @@ -480,7 +483,7 @@ sub dac_search_file_path_stem ($$$) { my ($ns, $ln, $suffix) = @_; require File::Spec; - for my $dir ('.', @{$Opt{input_search_path}->{$ns}||[]}) { + for my $dir (@{$Opt{input_search_path}->{$ns}||[]}) { my $name = Cwd::abs_path (File::Spec->canonpath (File::Spec->catfile ($dir, $ln))); @@ -586,6 +589,7 @@ sub daf_generate_perl_test_file ($) { my $mod = shift; my $pc = $impl->get_feature (ExpandedURI q => '1.0'); + local $Message::Util::DIS::Perl::Implementation = $pc; my $pl = $pc->create_perl_file; my $pack = $pl->get_last_package ("Manakai::Test", make_new_package => 1); $pack->add_use_perl_module_name ("Message::Util::DIS::Test"); @@ -598,6 +602,23 @@ $pl->license_uri ($mod->get_property_resource (ExpandedURI q) ->uri); + $pack->append_code (' + use Getopt::Long; + my %Skip; + GetOptions ( + "Skip=s" => sub { + shift; + for (split /\s+/, shift) { + if (/^(\d+)-(\d+)$/) { + $Skip{$_} = 1 for $1..$2; + } else { + $Skip{$_} = 1; + } + } + }, + ); + '); + $pack->append_code ($pc->create_perl_statement ('my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({ @@ -617,10 +638,16 @@ if ($res->is_type_uri (ExpandedURI q)) { if ($res->is_type_uri (ExpandedURI q)) { - $total_tests++; + my $test_num = ++$total_tests; + my $test_uri = $res->name_uri || $res->uri; + $pack->append_code ('$test->start_new_test ('); - $pack->append_new_pc_literal ($res->name_uri || $res->uri); + $pack->append_new_pc_literal ($test_uri); $pack->append_code (');'); + + $pack->append_code ('if (not $Skip{'.$test_num.'} and not $Skip{'); + $pack->append_new_pc_literal ($test_uri); + $pack->append_code ('}) {'); $pack->append_code ('try {'); @@ -641,6 +668,8 @@ $test->not_ok; };'); + $pack->append_code ('} else { warn "'.$test_num.' skipped\n" }'); + } elsif ($res->is_type_uri (ExpandedURI q)) { my $block = $pack->append_new_pc_block; my @test;