GNOME Bugzilla – Bug 508346
Use GLib test API
Last modified: 2009-03-16 22:13:44 UTC
We could use the GLib test API for the parser tests, and make it run on `make check`.
Created attachment 124216 [details] [review] Convert totem-pl-parser to use GTest API This converts all the old tests to the new API, keeping as much as possible. I've rewritten them somewhat so they're more automated, and removed some output from them (relying on assertions instead). I've commented out all the tests for totem_pl_parser_relative, since it's a function private to totem-pl-parser, and is relatively simple anyway. Would it be OK to remove these tests altogether? Not all of the tests pass at the moment, so that needs to be fixed (either here or in the relevant plparser code).
One big problem though, the test-parser and disc-test were also very useful for "by-hand" debugging, without the need for recompilation. That ability needs to be kept (even if it means sharing some of the code with the GTester backend). Otherwise looks good to me.
Created attachment 124445 [details] [review] Convert totem-pl-parser to use GTest API (updated) This adds back in most of the command-line options to ./disc and ./parser, maintaining feature parity with the old versions. I still need to know what to do with the totem_pl_parser_relative tests.
Why is it a problem that totem_pl_parser_relative() is a semi-private function? It's exported in the -private.h header, and exported through the symbols...
OK, I'll uncomment the relative tests (which work). Should I then commit, after branching?
Yeah, go for it.
2009-03-16 Philip Withnall <philip@tecnocode.co.uk> * Makefile.decl: * configure.in: * plparse/Makefile.am: * plparse/disc-test.c: * plparse/test-parser.c: * plparse/tests/541405.xml: * plparse/tests/560051.xml: * plparse/tests/Makefile.am: * plparse/tests/disc.c: * plparse/tests/parser.c: Convert totem-pl-parser to use the GTest API for its test suite. The test suite has also been improved a little, and is consequently more automated. Feature parity with the old code for manually testing discs is maintained. (Closes: #508346)