Bug 22491 - Add unit test skeleton for the WebKit/Gtk+ API
Summary: Add unit test skeleton for the WebKit/Gtk+ API
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks: 21837
  Show dependency treegraph
 
Reported: 2008-11-25 12:00 PST by Holger Freyther
Modified: 2008-12-07 11:17 PST (History)
0 users

See Also:


Attachments
Add unit test skeletong for WebKit/Gtk+ (2.76 KB, patch)
2008-11-25 12:03 PST, Holger Freyther
eric: review-
Details | Formatted Diff | Diff
Add unit test skeleton for WebKit/Gtk+ (2.86 KB, patch)
2008-11-26 08:11 PST, Holger Freyther
eric: review+
Details | Formatted Diff | Diff
Reference of skeleton + test case (4.52 KB, patch)
2008-11-26 12:18 PST, Holger Freyther
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Freyther 2008-11-25 12:00:23 PST
Use the glib testing classes to test our API.
Comment 1 Holger Freyther 2008-11-25 12:03:03 PST
Created attachment 25493 [details]
Add unit test skeletong for WebKit/Gtk+

Integrate unit testing into the build process. glib 2.16 introduced the testing classes and the code should cope with that.
Comment 2 Eric Seidel (no email) 2008-11-25 17:58:44 PST
Comment on attachment 25493 [details]
Add unit test skeletong for WebKit/Gtk+

It seems silly to add this w/o any test at all.  How do we know it works if it doesn't actually test anything?  Also the pre 2.1.6 version shoudn't just return 0, it should probably at least write a message to the console, no?  and probably return 1?  Whatever tool is calling it should know the tests failed to run because it was built with an old gtk, no?
Comment 3 Holger Freyther 2008-11-26 04:50:01 PST
Hmm. there is a test inside the Bug #21837 and it is blocked by the skeleton and build change to be added. It makes sense to do the split up. So I don't think it is silly at all.

As the skeleton/framework/buildsystem has nothing to do with the issue of #21837 I have done the split up...

And regarding pre glib 2.16 versions. I think people using it are stuck in the past and will not be able to run "run-webkit-tests" anyway. I don't mind adding a message that unit testing is not possible but I doubt anyone with older glib will see it.

So as there is a test in the queue as well would you please reconsider your "silly" statement?
Comment 4 Holger Freyther 2008-11-26 08:11:35 PST
Created attachment 25519 [details]
Add unit test skeleton for WebKit/Gtk+

This is about the questions:
  - Do we test the API?
  - How do we test (which framework to use)?
  - Where do we put the test(s)?

My answers:
  - Sure
  - We use the glib testing facilities
  - Like Gtk/Glib in a "tests" directory next to the source


What we test:
   - There is a first bug with test case in the referenced bug, so this bug actually has an impact. But in general that is a different question and depends on the actual bug and feature...
Comment 5 Eric Seidel (no email) 2008-11-26 12:18:20 PST
Comment on attachment 25519 [details]
Add unit test skeleton for WebKit/Gtk+

Looks fine.

You'll need a ChangeLog when you land of course.  Also, generally the copyright line includes the author's email, but I guess that's not required.
Comment 6 Holger Freyther 2008-11-26 12:18:38 PST
Created attachment 25527 [details]
Reference of skeleton + test case

This is for reference to see how the skeleton is filled with content. I would prefer if the test case is landed together with the bugfix from bug #21837.

The skeleton should just be added before the landing of the fix...
Comment 7 Holger Freyther 2008-12-07 11:17:35 PST
Landed in r39082. The skeleton will be filled with content once we have a fix for Bug #21837.