[PATCH weston v3 4/5] Enables output in the JUnit XML format.
Daniel Stone
daniel at fooishbar.org
Mon Jun 1 03:09:50 PDT 2015
Hi,
On 27 May 2015 at 00:06, Jon A. Cruz <jonc at osg.samsung.com> wrote:
> +void emit_escaped(int fd, const char *str)
> +{
> + const char *ptr = str;
> + while (*ptr) {
> + switch (*ptr) {
> + case '\'':
> + dprintf(fd, "'");
> + break;
> + case '\"':
> + dprintf(fd, """);
> + break;
> + case '<':
> + dprintf(fd, "<");
> + break;
> + case '>':
> + dprintf(fd, ">");
> + break;
> + case '&':
> + dprintf(fd, "&");
> + break;
> + default:
> + if ((*ptr >= ' ') && (*ptr < 0x7f)) {
> + dprintf(fd, "%c", *ptr);
> + } else {
> + dprintf(fd, "&#x%02X;", 0x0ff & *ptr);
> + }
> + }
> + ptr++;
> + }
> +}
Ouch. We can't reimplement our own XML creator: I know it looks easy
enough at first, and you can get away with it for a while, but it's
going to be a thorn in our side as we continually need to update it.
Can we please pick a simple/light/common library (sadly Expat doesn't
appear to handle creation), with the dependency being optional such
that you don't get JUnit output if it's not available, but we don't
fail compilation unless the user has explicitly requested it?
Sorry - just been down this path too many times previously in other projects.
Cheers,
Daniel
More information about the wayland-devel
mailing list