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 631214 - test-languagemanager.c is testing system language-specs instead of in-tree ones (fails on fresh install)
test-languagemanager.c is testing system language-specs instead of in-tree on...
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
: 652525 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-10-03 09:47 UTC by Mart Raudsepp
Modified: 2013-02-21 11:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix test-language when GtkSourceView is not installed (1.34 KB, patch)
2013-02-20 22:23 UTC, Sébastien Wilmet
accepted-commit_now Details | Review
Fix test-languagemanager when GtkSourceView is not installed (1.38 KB, patch)
2013-02-20 22:23 UTC, Sébastien Wilmet
accepted-commit_now Details | Review

Description Mart Raudsepp 2010-10-03 09:47:00 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.
Comment 1 Mart Raudsepp 2010-10-03 10:06:22 UTC
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.
Comment 2 letharion 2011-06-14 07:29:09 UTC
*** Bug 652525 has been marked as a duplicate of this bug. ***
Comment 3 Sébastien Wilmet 2013-02-20 22:23:18 UTC
Created attachment 236988 [details] [review]
Fix test-language when GtkSourceView is not installed
Comment 4 Sébastien Wilmet 2013-02-20 22:23:22 UTC
Created attachment 236989 [details] [review]
Fix test-languagemanager when GtkSourceView is not installed
Comment 5 Ignacio Casal Quinteiro (nacho) 2013-02-21 07:08:42 UTC
Review of attachment 236988 [details] [review]:

Looks good.
Comment 6 Ignacio Casal Quinteiro (nacho) 2013-02-21 07:11:44 UTC
Review of attachment 236989 [details] [review]:

Looks good.
Comment 7 Sébastien Wilmet 2013-02-21 11:48:27 UTC
Pushed.