Closed
Bug 365212
Opened 18 years ago
Closed 18 years ago
Use xpcshell based unit test framework
Categories
(Calendar :: Internal Components, defect)
Calendar
Internal Components
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: mvl, Assigned: mvl)
Details
Attachments
(2 files)
|
5.13 KB,
patch
|
Details | Diff | Splinter Review | |
|
21.82 KB,
patch
|
jminta
:
first-review+
|
Details | Diff | Splinter Review |
We have a calendar/test directory, with some js based tests in there. But I don't think they really work.
If we switch to the xpcshell based unit test framework, the one in mozilla/tools/test-hardness, we can make tests more easily. It does include an eventloop, so we can test async providers. It also integrates with the build system, so we can make tinderboxes go orange on failed tests.
| Assignee | ||
Comment 1•18 years ago
|
||
We can't make tinderbox run the tests just yet, because we use the tinderboxes also for distributing builds: bug 351968.
| Assignee | ||
Updated•18 years ago
|
Assignee: nobody → mvl
| Assignee | ||
Comment 2•18 years ago
|
||
This patch changes the makefiles such that unit tests can be added to calendar/test/unit, as described in http://developer.mozilla.org/en/docs/Writing_xpcshell-based_unit_tests
Attachment #249882 -
Flags: first-review?(dmose)
| Assignee | ||
Comment 3•18 years ago
|
||
Those first tests are partly conversions from the existing tests in test/homegrown/misc. Some came from libical/test-data/recur.txt. And I just made up some others.
| Assignee | ||
Updated•18 years ago
|
Attachment #249887 -
Flags: first-review?(jminta)
Comment 4•18 years ago
|
||
Comment on attachment 249887 [details] [diff] [review]
firsts tests
+++ test/unit/test_attendee.js 2006-12-28 11:41:18.000000000 +0100
+ // Create event
+ var event = eventClass.createInstance(eventIID);
Can you move this down closer to where it's actually going to be used?
+function findById(event, id, a) {
+ var foundAttendee = event.getAttendeeById(id);
+ do_check_eq(foundAttendee, a);
Do we need to be concerned about the wrapping problems we encounter elsewhere in the code?
+++ test/unit/test_datetime.js 2006-12-27 23:44:15.000000000 +0100
+ cd.timezone = "/mozilla.org/20050126_1/America/Bogota";
+ cd.normalize();
+
+ do_check_eq(cd.hour, 10);
+ do_check_eq(cd.icalString, "20051113T100000");
Why does icalString not include TZID= ?
+++ test/unit/test_ics_roundtrip.js 2006-12-28 16:09:01.000000000 +0100
+function checkRoundtrip(expectedProps, obj) {
+ for (var key in expectedProps) {
+ // Need translation
+ icskey = key;
Strict warning, and the comment should probably be a bit more verbose.
r=jminta with that.
Attachment #249887 -
Flags: first-review?(jminta) → first-review+
| Assignee | ||
Comment 5•18 years ago
|
||
(In reply to comment #4)
> Why does icalString not include TZID= ?
Because the tzid is a parameter, and not part of the property value (in rfc2445 speak).
Yes, it is confusing, and i'm not sure what to do about it.
Updated•18 years ago
|
Attachment #249882 -
Flags: first-review?(dmose)
Comment 6•18 years ago
|
||
mvl:
I think this can go in now. I suspect dmose won't be maintaining his old tests anyway :)
Comment 7•18 years ago
|
||
Per our calendar-qa phone conference meeting today, we've landed these patches.
The old tests were left until we can confirm with dmose that they're okay to delete.
-> FIXED
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
Version: Trunk → unspecified
You need to log in
before you can comment on or make changes to this bug.
Description
•