webidl2tests

NAME

wttjs.pl - WebIDL ECMAScript Binding Test Suite Generator

SYNOPSIS

  $ perl wttjs.pl \
        --idl-file-name input.idl \
        --instances-file-name input.json \
        --test-dir-name output-dir/ \
        --testset-id testname

  $ perl wttjs.pl --help

DESCRIPTION

The script wttjs.pl generates a set of test cases for the conformance of a Web browser's DOM implementation, with regard to a set of interfaces described by a WebIDL fragment.

For more information, see the readme document https://suika.suikawiki.org/www/webidl2tests/readme.

ARGUMENTS

This script accepts command-line arguments in the Getopt::Long style. Any argument can be specified at most once.

--help

Show the help on the command-line arguments and exit the script.

--idl-file-name file-name.idl (REQUIRED)

The name or path of the file that contains the IDL fragment that defines a set of interfaces and exceptions to be tested against.

If this argument is not specified, if the specified file is not found, or if the file cannot be read due to some I/O error, the script would exit with an error message.

The file must be encoded in UTF-8 (Perl's utf-8 encoding). Otherwise, the result test cases might be broken.

The file must contain a syntactically valid IDL fragment. Any failure to conform to the WebIDL syntax would be reported to the standard error output. Such errors are handled by the CSS-like forward-compatible parsing rule as implemented by the Whatpm::WebIDL parser.

Though the content of the file don't have to be a conforming IDL fragment, the result test cases might be broken if it is not. It is encouraged to check the conformance of the input IDL fragment by a conformance checker, e.g. WebHACC https://suika.suikawiki.org/gate/2007/html/cc/.

--instances-file-name file-name.json (Default: No instance generation)

The name or path of the file that contains supplement information on interfaces and exceptions defined in the IDL fragment.

If the specified file is not found, or if the file cannot be read due to some I/O error, the script would exit with an error message.

The file must be encoded in UTF-8 (Perl's utf-8 encoding). Otherwise, the file might be considered as broken, or the result test cases might be broken.

The file must contain a JSON representation of a data structure described in the readme document. If the content is not valid as JSON, then the script would exit with an error message. If the content does not encode the data structure specified in the readme document, the script might exit with a Perl script execution error. Even when no Perl error stops the script, the result test cases might be broken.

If this argument is not specified, then it is assumed that no additional information is available.

--test-dir-name path-to-dir/ (Default: ./tests/)

The name or path of the directory, in which the directory for the test files is created.

The default value that is used when this argument is not specified is ./tests/.

All files generated by this script is put into the directory test-dir-name/testset-id/, where test-dir-name is the value specified by the --test-dir-name argument and testset-id is the value specified by the --testset-id argument. If there is no such a directory, then it is created by the script.

--testset-id id (REQUIRED)

The identifier of the test suite.

If this argument is not specified, the script would exit with an error message.

Though any value can be specified as identifier, it should be a string consist of characters a..z, 0..9, and - only, with no leading - character, for filesystem safety and compatibility with the test result summary script (see the readme document).

DEPENDENCY

This script, in addition to Perl 5.8.* or later, requires the following modules:

JSON

A JSON parser and serializer, which is available from CPAN.

To install the JSON module from the CPAN, type:

  # perl -MCPAN -eshell
  cpan> install JSON
Whatpm::WebIDL

A WebIDL parser and object model implementation, which is part of the Whatpm package https://suika.suikawiki.org/www/markup/html/whatpm/readme.

Note that Whatpm::WebIDL does not depend on any other module.

If you are using the Git version, the manakai repository is found in the modules/manakai directory as a submodule, so you only have to clone it by:

  $ git submodule update --init

SEE ALSO

Readme https://suika.suikawiki.org/www/webidl2tests/readme.

Web IDL specification, revision 1.96 (3 September 2008 Editor's Draft) http://dev.w3.org/cvsweb/~checkout~/2006/webapi/WebIDL/Overview.html?rev=1.96&content-type=text/html;%20charset=utf-8.

Whatpm::WebIDL, which is used to parse IDL fragments.

AUTHOR

Wakaba <wakaba@suikawiki.org>

LICENSE

Copyright 2008-2011 Wakaba <wakaba@suikawiki.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.