GNOME Bugzilla – Bug 631214
test-languagemanager.c is testing system language-specs instead of in-tree ones (fails on fresh install)
Last modified: 2013-02-21 11:48:27 UTC
test-languagemanager.c fails tests on a first install, because it doesn't use the language-specs files of the build tree, but rather the system tree, and it has an assert on the return value of gtk_source_language_manager_get_language_ids, so as there are no system installed language files, it returns a valid NULL, test code asserts and tests fail. The failure is one thing, but unit tests ought to test the build tree version and files, not an arbitrary version of the language files in the system install. So I suspect gtk_source_language_manager_get_search_path () or similar needs to somehow be adjusted to return only $top_srcdir/gtksourceview/language-specs or such during tests (and not be affected by legacy ~/.gnome2/gtksourceview-1.0/language-specs user dir either during tests). Downstream report at http://bugs.gentoo.org/339441 Another bug in test-languagemanager in bug #621383 - we see the failure reported here after the subtest covered there is disabled downstream, showing the problem with wrong language-specs being used during testing.
Making check in tests make[1]: Entering directory `/var/tmp/portage/x11-libs/gtksourceview-2.10.5/work/gtksourceview-2.10.5/tests' make check-TESTS make[2]: Entering directory `/var/tmp/portage/x11-libs/gtksourceview-2.10.5/work/gtksourceview-2.10.5/tests' Xlib: extension "RANDR" missing on display ":0.0". /LanguageManager/get-default: OK /LanguageManager/get-language: ** GtkSourceView:ERROR:test-languagemanager.c:25:test_get_language: assertion failed: (ids != NULL) /bin/sh: line 5: 30282 Aborted ${dir}$tst FAIL: test-languagemanager Xlib: extension "RANDR" missing on display ":0.0". /PrintCompositor/buffer-ref: OK /PrintCompositor/buffer-view-ref: OK PASS: test-printcompositor ============================================================================== 1 of 2 tests failed Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=gtksourceview ============================================================================== make[2]: *** [check-TESTS] Error 1 make[2]: Leaving directory `/var/tmp/portage/x11-libs/gtksourceview-2.10.5/work/gtksourceview-2.10.5/tests' make[1]: *** [check-am] Error 2 make[1]: Leaving directory `/var/tmp/portage/x11-libs/gtksourceview-2.10.5/work/gtksourceview-2.10.5/tests' make: *** [check-recursive] Error 1 The RANDR warnings are just because Xvfb is used to provide a DISPLAY during package managers testing and warnings come from gtk+, not a concern during gtksourceview tests. The error happens because system location has no language-specs installed yet and so returns NULL from gtk_source_language_manager_get_language_ids (lm) and an assert check is on that - should be made to use (only) language-specs from build tree.
*** Bug 652525 has been marked as a duplicate of this bug. ***
Created attachment 236988 [details] [review] Fix test-language when GtkSourceView is not installed
Created attachment 236989 [details] [review] Fix test-languagemanager when GtkSourceView is not installed
Review of attachment 236988 [details] [review]: Looks good.
Review of attachment 236989 [details] [review]: Looks good.
Pushed.