bug test links (Re: RFC: GLib testing framework)



On Tue, 6 Nov 2007, Matthias Clasen wrote:

On Nov 6, 2007 2:19 PM, Tim Janik <timj imendio com> wrote:
On Tue, 6 Nov 2007, Matthias Clasen wrote:

On 11/1/07, Tim Janik <timj imendio com> wrote:

One thing I find pretty useful, that has not been mentioned so far (or
I missed it) is regression tests for bugs. For these it is very useful
to have some standardized way to refer to the bug they are testing.

people can use any naming scheme they want, there's no dictate for that in
the framework. e.g you could start to label your tests like this:

   g_test_add_func ("/gtk/bug/4711", test_rand1);
   g_test_add_func ("/gtk/bug/4712", test_assertions);
   g_test_add_func ("/gtk/bug/1313", test_timer);


I was hoping for some way to associate bug numbers with test cases
that would allow
the report to contain a link to the bug.

tko suggested a very simple call "bug (12345);" inside a test case.

i think tihs could be feasible:

void	g_test_bugzilla (const gchar *bugzilla_url_prefix);
void	g_test_bug      (guint        bugid);

g_test_bugzilla() if called outside a testcase will set the default
bugzilla url for all test cases. if called inside a test case, it
sets the bugzilla url for the scope of the case only.
g_test_bug() can be called inside a testcase, and cause a #bugid
link to appear in the test report.
for gtk and glib specifically, g_test_bugzilla() could default to
the gnome bugzilla projects from some glib/gtk specific test program
boilerplate function, e.g. gtk_test_init (&argc, &argv).

---
ciaoTJ


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]