After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730447 - Add testsuite
Add testsuite
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: libgnome-desktop
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-20 13:57 UTC by Kalev Lember
Modified: 2014-05-30 12:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add testsuite skeleton (31.75 KB, patch)
2014-05-20 13:58 UTC, Kalev Lember
committed Details | Review
tests: Add a wall clock test for colon vs ratio character use (2.19 KB, patch)
2014-05-20 21:27 UTC, Kalev Lember
committed Details | Review
tests: Add a wall clock test for 12/24h gsettings switch (2.17 KB, patch)
2014-05-20 21:27 UTC, Kalev Lember
needs-work Details | Review
tests: Add a wall clock test for the notify::clock callback (1.82 KB, patch)
2014-05-20 21:49 UTC, Kalev Lember
none Details | Review
tests: Add a wall clock test for the notify::clock callback (2.05 KB, patch)
2014-05-20 22:27 UTC, Kalev Lember
committed Details | Review
tests: Add a wall clock test for 12/24h gsettings switch (2.17 KB, patch)
2014-05-21 10:37 UTC, Kalev Lember
committed Details | Review

Description Kalev Lember 2014-05-20 13:57:51 UTC
hadess pointed out on IRC that we'll need a test suite for bugs such as https://bugzilla.gnome.org/show_bug.cgi?id=730402 . This is the first cut at adding one.
Comment 1 Kalev Lember 2014-05-20 13:58:22 UTC
Created attachment 276863 [details] [review]
Add testsuite skeleton
Comment 2 Kalev Lember 2014-05-20 21:27:28 UTC
Created attachment 276897 [details] [review]
tests: Add a wall clock test for colon vs ratio character use
Comment 3 Kalev Lember 2014-05-20 21:27:32 UTC
Created attachment 276898 [details] [review]
tests: Add a wall clock test for 12/24h gsettings switch
Comment 4 Kalev Lember 2014-05-20 21:49:09 UTC
Created attachment 276900 [details] [review]
tests: Add a wall clock test for the notify::clock callback
Comment 5 Kalev Lember 2014-05-20 22:27:22 UTC
Created attachment 276904 [details] [review]
tests: Add a wall clock test for the notify::clock callback
Comment 6 Bastien Nocera 2014-05-21 10:27:06 UTC
Review of attachment 276904 [details] [review]:

::: tests/wall-clock.c
@@ +133,3 @@
+
+	/* Show seconds so we don't have to wait too long for the callback */
+	g_settings_set_boolean (settings, "clock-show-seconds", TRUE);

Won't that modify the settings of the user that the test suite is running under?
Comment 7 Bastien Nocera 2014-05-21 10:28:02 UTC
Review of attachment 276897 [details] [review]:

Looks good
Comment 8 Bastien Nocera 2014-05-21 10:29:33 UTC
Review of attachment 276898 [details] [review]:

::: tests/wall-clock.c
@@ +108,3 @@
 	g_test_init (&argc, &argv, NULL);
 
+	g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);

Shouldn't that be before g_test_init() to ensure that GIO isn't loaded before we set the GSettings backend?
Comment 9 Bastien Nocera 2014-05-21 10:30:14 UTC
Review of attachment 276904 [details] [review]:

I missed the change of backend in the earlier patch.
Comment 10 Bastien Nocera 2014-05-21 10:31:59 UTC
Review of attachment 276863 [details] [review]:

Looks fine.
Comment 11 Bastien Nocera 2014-05-21 10:33:18 UTC
You'll need a GTK+ test in your test suite, to check for ordering (RTL vs. LTR) correctly, for all the languages translated in po/*.po
Comment 12 Kalev Lember 2014-05-21 10:36:51 UTC
(In reply to comment #8)
> Review of attachment 276898 [details] [review]:
> 
> ::: tests/wall-clock.c
> @@ +108,3 @@
>      g_test_init (&argc, &argv, NULL);
> 
> +    g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);
> 
> Shouldn't that be before g_test_init() to ensure that GIO isn't loaded before
> we set the GSettings backend?

Ah yes, good idea. Fixed.
Comment 13 Kalev Lember 2014-05-21 10:37:20 UTC
Created attachment 276925 [details] [review]
tests: Add a wall clock test for 12/24h gsettings switch
Comment 14 Bastien Nocera 2014-05-21 10:43:59 UTC
Review of attachment 276925 [details] [review]:

Looks good
Comment 15 Bastien Nocera 2014-05-30 12:18:21 UTC
I also added a test case for GTK+' rendering of those results

Attachment 276863 [details] pushed as 08406dc - Add testsuite skeleton
Attachment 276897 [details] pushed as 4faf1d2 - tests: Add a wall clock test for colon vs ratio character use
Attachment 276904 [details] pushed as cb9597a - tests: Add a wall clock test for the notify::clock callback
Attachment 276925 [details] pushed as 2616fe3 - tests: Add a wall clock test for 12/24h gsettings switch