[Piglit] use JSON to report between tests and the python framework

Dylan Baker baker.dylan.c at gmail.com
Wed Jun 11 16:32:30 PDT 2014

This series replaces the use of eval() in
exectest.PiglitTest.interpret_restul() with json.loads(). This has a
couple of advantages. First, eval compiles code on the fly, and is known
to be slow. It's better not to use eval whenever possible for that
reason alone. But the more serious problem is that eval() allows for
arbitrary code execution.

Fortunately for us python dicts (which is what we use eval() on) looks a
lot like JSON, and we already ahve a fast JSON library available.

Patch 1 replaces eval() with json
Patch 2 makes subtest reporting simpler, by leveraging JSON
Patch 3 removes some extra whitespce in our output, I'm kinda iffy on
whether this patch is worth it.

More information about the Piglit mailing list