[Spice-devel] [PATCH] spice-xpi test page generator

Peter Hatina phatina at redhat.com
Thu Jun 28 01:20:47 PDT 2012


On 06/27/2012 04:40 PM, Marc-André Lureau wrote:
> Hi
> 
> ----- Mensaje original -----
>> On Wed, Jun 27, 2012 at 02:00:48PM +0200, Peter Hatina wrote:
>>> Hi,
>>>
>>> David Jasa gave me an input to create some tool for automatic
>>> generation
>>> of spice-xpi test page. So here we are. I tried to be as
>>> simplistic, as
>>> possible. There is a huge context free grammar described at mozilla
>>> dev
>>> pages, but for our purposes, it exceeds the needs (also I've found,
>>> that
>>> there are some mistakes in the rules, that do not correspond with
>>> the
>>> reality). The grammar has been adapted for the needs of spice-xpi
>>> IDL
>>> file. Not to drag other dependencies for spice-xpi, I used C++ and
>>> STL
>>> only. It could have been done by flex/lex + yacc/bison, but why to
>>> use
>>> other deps for a simple plugin.
>>
>> Insane :)
> 
> totally!
> 
>> Didn't test it, just glossed over, I don't really understand why we
>> need
>> it but it looks great.
> 
> +    std::cout << "Spice-xpi test page generator\n\n"
> +              << "Usage: ./generator [-h] [-i input] [-o output]\n\n"
> +              << "Application options:\n"
> +              << "  -i, --input     input filename (stdin used, if not specified)\n"
> +              << "  -o, --output    output filename (stdout used, if not specified)\n"
> +              << "  -h, --help      prints this help\n";
> 
> Could you explain the use case? How does it work? Give some example, write a readme or something. I am a little bit afraid that this is something too big to maintain here. Also, it should probably be in some subdirectory (if not in a separate repository)
> 

Ok let me begin:
The test page, that David created is fine, there were some typos, when
copying the input elements, but nothing special. We (me and him) agreed
to create something, that will automatically recreate the page based on
the IDL input. Yes, there are some parts of the generated code, which
are static, but the input elements and buttons are created automatically
(based on the IDL attributes and functions/methods).

How it works:
./generator -i <input IDL file> -o <output HTML file>

or, when no cli options passed, it simply reads from stdin and writes to
stdout

Wrt own repository:
I would like to push this in some own directory with spice-xpi repo.
>From my point of view, it kind of belongs to spice-xpi (as the current
test.html in data dir).

-- 
Peter Hatina
EMEA ENG-Desktop Development
Red Hat Czech, Brno




More information about the Spice-devel mailing list