GNOME Bugzilla – Bug 613234
gjs-unit fails to find the test files
Last modified: 2011-01-10 17:33:30 UTC
Running make check is failing for me with ** ERROR:(gjs-unit.c:172):main: assertion failed: (dir != NULL)
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.
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.
Attachment 156444 [details] pushed as 14904c4 - test: handle multiple absolute paths when building filename
*** Bug 597925 has been marked as a duplicate of this bug. ***