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 613234 - gjs-unit fails to find the test files
gjs-unit fails to find the test files
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
: 597925 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-03-18 12:13 UTC by Tommi Komulainen
Modified: 2011-01-10 17:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test: handle multiple absolute paths when building filename (3.54 KB, patch)
2010-03-18 12:13 UTC, Tommi Komulainen
committed Details | Review

Description Tommi Komulainen 2010-03-18 12:13:15 UTC
Running make check is failing for me with

** ERROR:(gjs-unit.c:172):main: assertion failed: (dir != NULL)
Comment 1 Tommi Komulainen 2010-03-18 12:13:17 UTC
Created attachment 156444 [details] [review]
test: handle multiple absolute paths when building filename

When GJS_TOP_SRCDIR is an absolute path g_build_filename constructs the
paths in a way we're not expecting, e.g. given path elements

    ["/top_builddir", "/top_srcdir", NULL]

we're expecting to get "/top_srcdir" but g_build_filename is returning
"/top_builddir/top_srcdir". This results in gjs-unit looking for test
files in wrong directory and dying with

    ** ERROR:(gjs-unit.c:172):main: assertion failed: (dir != NULL)

Add custom function to handle absolute paths as we're expecting.
Comment 2 Owen Taylor 2010-03-18 21:37:46 UTC
Review of attachment 156444 [details] [review]:

Looks fine, even if I still feel that using an absolute path to configure for srcdir != builddir is weird. :-)

::: test/gjs-unit.c
@@ +121,3 @@
+        g_ptr_array_add(array, (char*)first_element);
+
+        first_element = va_arg(ap, const char *);

Reassigning first_element like this makes for poor readability. Should have a separate const char *arg that you initialize to first_element then update.
Comment 3 Tommi Komulainen 2011-01-10 17:31:22 UTC
Attachment 156444 [details] pushed as 14904c4 - test: handle multiple absolute paths when building filename
Comment 4 Tommi Komulainen 2011-01-10 17:33:30 UTC
*** Bug 597925 has been marked as a duplicate of this bug. ***