--- messaging/manakai/bin/daf.pl 2006/02/26 14:32:38 1.3 +++ messaging/manakai/bin/daf.pl 2006/03/17 08:06:20 1.7 @@ -116,20 +116,23 @@ use Message::Util::DIS::DNLite; use Message::Util::PerlCode; -use Message::Util::DIS::Test; -use Message::DOM::GenericLS; + +my %feature; +eval q{ + use Message::Util::DIS::Test; + use Message::DOM::GenericLS; + $feature{ExpandedURI q} = '3.0'; + $feature{'+' . ExpandedURI q} = '1.0'; +}; my $limpl = $Message::DOM::ImplementationRegistry->get_implementation ({ExpandedURI q => '3.0', - ExpandedURI q => '3.0', '+' . ExpandedURI q => '1.0', '+' . ExpandedURI q => '1.0', '+' . ExpandedURI q => '1.0', - '+' . ExpandedURI q => '1.0', + %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 @@ -210,7 +213,6 @@ unless (defined $ModuleSourceDISDocument{$module_uri}) { daf_open_source_dis_document ($module_uri); } - daf_convert_dis_document_to_dnl_document (); } return daf_get_referring_module_uri_list ($module_uri); }, @@ -338,6 +340,9 @@ undef $db; status_msg "done"; +undef $limpl; +undef $impl; + { use integer; my $time = time - $start_time; @@ -581,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"); @@ -593,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 ({ @@ -612,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 {'); @@ -636,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; @@ -662,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) {