1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
#!/usr/bin/perl
use strict;
use Data::Dumper;
use XML::Simple;
my $manifest = XMLin("./manifest.xml");
# print Dumper($manifest->{'assert'});
my $perSpecId;
my @allTests;
my @ecmaTests;
my @xpathTests;
my @agnosticTests;
my @nullTests;
my @manualTests;
for my $testNr (keys $manifest->{'assert'}) {
my @tests;
my $thisTest = $manifest->{'assert'}->{$testNr};
if (ref($thisTest->{'test'}->{'start'}) eq "ARRAY") {
push (@tests, @{$thisTest->{'test'}->{'start'}});
} else {
push (@tests, $thisTest->{'test'}->{'start'});
}
$perSpecId->{$thisTest->{'specnum'}.':'.$thisTest->{'specid'}}->{'total'} += @tests;
if ($thisTest->{'test'}->{'manual'} eq "true") {
$perSpecId->{$thisTest->{'specnum'}.':'.$thisTest->{'specid'}}->{'manual'} += @tests;
push @manualTests, @tests;
}
if ($thisTest->{'specid'} eq "#minimal-profile" || $thisTest->{'specid'} !~ /profile$/) {
push @nullTests, @tests;
}
if ($thisTest->{'specid'} eq "#ecma-profile" || $thisTest->{'specid'} !~ /profile$/) {
push @ecmaTests, @tests;
}
if ($thisTest->{'specid'} eq "#xpath-profile" || $thisTest->{'specid'} !~ /profile$/) {
push @xpathTests, @tests;
}
push (@allTests, @tests);
push @agnosticTests, @tests if ($thisTest->{'specid'} !~ /profile$/);
}
# print Dumper(@ecmaTests);
my %datamodels = (
"ecma" => \@ecmaTests,
"xpath" => \@xpathTests,
"promela" => \@agnosticTests,
"prolog" => \@agnosticTests,
"lua" => \@ecmaTests
);
for my $datamodel (keys %datamodels) {
# every scxml file is a test
for (`ls $datamodel/*.scxml`) {
my $filename = $_;
chomp($filename);
if ($filename =~ /\/test(\d+\w?)\.scxml/) {
print("${filename} is not in mainfest\n") if (! grep $_->{'uri'} == "${1}/test${1}.scxml", @{$datamodels{$datamodel}});
}
}
# every test is given
for my $testURI (@{$datamodels{$datamodel}}) {
if ($testURI->{'uri'} =~ /^(\d+)\/(test\d+\w?)\.(txt|txml)$/) {
my $name = $2;
my $suffix = ($3 eq "txml" ? "scxml" : $3);
if (! -e "${datamodel}/${name}.${suffix}") {
print("${datamodel}/${name}.${suffix} is missing\n");
}
} else {
die ($testURI->{'uri'});
}
}
}
# print Dumper(@manualTests);
print "NULL : ".@nullTests."\n";
print "ECMA : ".@ecmaTests."\n";
print "XPATH: ".@xpathTests."\n";
print "\n";
print "MAN : ".@manualTests."\n";
print "ANY : ".@agnosticTests."\n";
print "TOTAL: ".@allTests."\n";
|