From df3f1f9f03ce6521d6bc690fc97d5b3a7c440fed Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Wed, 23 Nov 2016 15:41:19 +0100 Subject: Improved overview on test table --- test/w3c/create-test-table.pl | 141 +++++++++++++++++++++++++++++------------- 1 file changed, 98 insertions(+), 43 deletions(-) diff --git a/test/w3c/create-test-table.pl b/test/w3c/create-test-table.pl index f936817..630e0a4 100755 --- a/test/w3c/create-test-table.pl +++ b/test/w3c/create-test-table.pl @@ -1,13 +1,42 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl use strict; use Data::Dumper; use XML::Simple; +use File::Basename; +use File::Find; +use Cwd 'abs_path'; -my $manifest = XMLin("./manifest.xml"); -# print Dumper($manifest->{'assert'}); +my $ctest = 'ctest'; # we assume it to be in the path -my $perSpecId; +my $possibleBuildDir = shift | "../../build/cli"; +chdir dirname(abs_path($0)) or die($!); +my $manifest = XMLin("manifest.xml"); + +if (-d $possibleBuildDir) { + chdir $possibleBuildDir or die($!); +} + +my %testClasses = ( +'w3c/ecma/' => 'ECMA', +'w3c/lua/' => 'Lua', +'w3c/namespace/' => 'NS', +'w3c/promela/' => 'Promela', +'w3c/c89/' => 'C89', +'w3c/gen/c/ecma/' => 'C (ECMA)', +'w3c/gen/c/lua/' => 'C (Lua)', +'w3c/binding/java/jexl/' => 'JEXL', +# 'w3c/spin/promela/' => 'Spin' +); + +my %specClass = ( +'3' => 'Core Constructs', +'4' => 'Executable Content', +'5' => 'Data Model and Manipulation', +'6' => 'External Communications', +'C' => 'Data Models', +'D' => 'Event I/O Processor' +); my %specName = ( 'C.1' => 'The Null Data Model', @@ -43,6 +72,8 @@ my %specName = ( my %specLink = ( ); +my $perSpecId; + TESTS: for my $testNr (keys $manifest->{'assert'}) { my @tests; my $thisTest = $manifest->{'assert'}->{$testNr}; @@ -71,23 +102,32 @@ TESTS: for my $testNr (keys $manifest->{'assert'}) { print << "EOF"; - - - - - - - - - - + + + + +EOF + +for my $testClass (values %testClasses) { + print << "EOF"; + +EOF + +} + +print << "EOF"; + + + EOF # print '| Test | | ECMA | Lua |' . "\n"; # print '|-----:|--|:------:|:---:|' . "\n"; +my $lastSpecClass = ""; for my $specid (sort { $a cmp $b } keys $perSpecId) { my $specName = $specName{$specid}; + my $specClass = $specClass{substr($specid, 0, 1)}; if ($specName =~ s/^<(.*)>$/ucfirst($1)/eg) { # $specName = join " ", map {ucfirst} split " ", $specName; $specName = 'The ' .$specName. ' Element'; @@ -96,19 +136,31 @@ for my $specid (sort { $a cmp $b } keys $perSpecId) { # print "|
| | | | |\n"; + if ($specClass ne $lastSpecClass) { + print << "EOF"; + + + +EOF + $lastSpecClass = $specClass; + } + my $link = "http://www.w3.org/TR/2015/REC-scxml-20150901/" . ${specLink{${specid}}}; print << "EOF"; - - - - + + + + EOF # print "| **[§${specid}](http://www.w3.org/TR/2015/REC-scxml-20150901/${specLink{${specid}}})** | **${specName}** |

| |\n"; for my $test (sort {$a<=>$b} keys $perSpecId->{$specid}) { + + print STDERR "\n${test} "; + my $content = $perSpecId->{$specid}->{$test}->{'content'}; $content =~ s/^\s+|\s+$//g ; # trim $content =~ s/[\n]//g; # remove special chars @@ -138,37 +190,37 @@ EOF my $output; - - my $pass = '`pass`'; - my $fail = '**`FAIL`**'; - - my $ecmaPass = $fail; - my $ecmaFile = "/Users/sradomski/Documents/TK/Code/uscxml2/test/w3c/ecma/test${test}.scxml"; - $output = `../../build/cli/bin/test-w3c $ecmaFile 2>&1 /dev/null`; - $ecmaPass = $pass if $? == 0; - - my $luaPass = $fail; - my $luaFile = "/Users/sradomski/Documents/TK/Code/uscxml2/test/w3c/lua/test${test}.scxml"; - $output = `../../build/cli/bin/test-w3c $luaFile 2>&1 /dev/null`; - $luaPass = $pass if $? == 0; - - my $nsPass = $fail; - my $nsFile = "/Users/sradomski/Documents/TK/Code/uscxml2/test/w3c/namespace/test${test}.scxml"; - $output = `../../build/cli/bin/test-w3c $nsFile 2>&1 /dev/null`; - $nsPass = $pass if $? == 0; + my $pass = 'pass'; + my $fail = 'FAIL'; $link = "https://github.com/tklab-tud/uscxml/tree/master/test/w3c/txml/test${test}.txml"; print << "EOF"; - + - - - - - +EOF + + for my $testClass (keys %testClasses) { + print STDERR "$testClasses{$testClass}"; + my $testPass = $fail; + my $testName = "${testClass}/test${test}.scxml"; + $output = `$ctest -L $testName 2>&1 /dev/null`; + if ($? == 0) { + $testPass = $pass; + print STDERR "+ " + } else { + print STDERR "! " + } + + print << "EOF"; + +EOF + + } + + print << "EOF"; EOF @@ -177,4 +229,7 @@ EOF } } -print '
Test (Req. / Man.)NameSpaceECMALuaPROMELAProlog
Test (Req. / Man.)${testClass}
${specClass}
**§${specid}** **${specName}** 
§${specid} ${specName} 
   **`${test}`**   ${test} ${required} ${manual}${nsPass}${ecmaPass}${luaPass}`N/A``N/A`${pass}
' + print << "EOF"; + + +EOF -- cgit v0.12