--- messaging/manakai/bin/daf.pl 2006/03/12 10:13:31 1.5 +++ messaging/manakai/bin/daf.pl 2006/03/18 05:57:48 1.8 @@ -133,8 +133,6 @@ %feature, }); my $impl = $limpl->get_feature (ExpandedURI q => '1.0'); -my $pc = $impl->get_feature (ExpandedURI q => '1.0'); -my $di = $impl->get_feature (ExpandedURI q => '1.0'); my $tdt_parser; ## --- Loading and Updating the Database @@ -342,6 +340,9 @@ undef $db; status_msg "done"; +undef $limpl; +undef $impl; + { use integer; my $time = time - $start_time; @@ -480,7 +481,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))); @@ -585,6 +586,7 @@ sub daf_generate_perl_test_file ($) { my $mod = shift; + my $pc = $impl->get_feature (ExpandedURI q => '1.0'); 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"); @@ -597,6 +599,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 ({ @@ -616,10 +635,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 {'); @@ -640,6 +665,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; @@ -666,6 +693,15 @@ not defined $ttest->{root_uri}; } + ## DOM configuration parameters + for my $v (@{$tres->get_property_value_list + (ExpandedURI q)}) { + my $cpuri = $v->name; + my $cp = $db->get_resource ($cpuri, for_arg => $tres->for_uri); + $ttest->{dom_config}->{$cp->get_dom_configuration_parameter_name} + = $v->get_perl_code ($block->owner_document, $tres); + } + ## Result DOM tree my $tree_t = $tres->get_property_text (ExpandedURI q); if (defined $tree_t) {