mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-12 20:24:04 +02:00
gio/tests: Some more fixes for installed tests
file passes now, appinfo needs a bit more work, but is getting there.
This commit is contained in:
@@ -419,6 +419,13 @@ endif OS_UNIX
|
|||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
desktop_test_files = \
|
||||||
|
appinfo-test.desktop \
|
||||||
|
appinfo-test2.desktop \
|
||||||
|
appinfo-test-gnome.desktop \
|
||||||
|
appinfo-test-notgnome.desktop \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
socket-common.c \
|
socket-common.c \
|
||||||
org.gtk.test.gschema \
|
org.gtk.test.gschema \
|
||||||
@@ -434,6 +441,7 @@ EXTRA_DIST += \
|
|||||||
test3.gresource.xml \
|
test3.gresource.xml \
|
||||||
test3.txt \
|
test3.txt \
|
||||||
test4.gresource.xml \
|
test4.gresource.xml \
|
||||||
|
$(desktop_test_files) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
MISC_STUFF = test.mo test.gresource
|
MISC_STUFF = test.mo test.gresource
|
||||||
@@ -491,15 +499,12 @@ distclean-local:
|
|||||||
test_files = \
|
test_files = \
|
||||||
contexts.c \
|
contexts.c \
|
||||||
g-icon.c \
|
g-icon.c \
|
||||||
|
file.c \
|
||||||
enums.xml.template \
|
enums.xml.template \
|
||||||
testenum.h \
|
testenum.h \
|
||||||
org.gtk.test.gschema.xml \
|
org.gtk.test.gschema.xml \
|
||||||
org.gtk.schemasourcecheck.gschema.xml \
|
org.gtk.schemasourcecheck.gschema.xml \
|
||||||
test.gresource \
|
test.gresource \
|
||||||
appinfo-test.desktop \
|
|
||||||
appinfo-test2.desktop \
|
|
||||||
appinfo-test-gnome.desktop \
|
|
||||||
appinfo-test-notgnome.desktop \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
EXTRA_DIST += $(test_files)
|
EXTRA_DIST += $(test_files)
|
||||||
|
|
||||||
@@ -524,4 +529,14 @@ testmeta_DATA = $(test_progs:=.test)
|
|||||||
echo 'Exec=env G_TEST_DATA=$(pkglibexecdir)/installed-tests $(pkglibexecdir)/installed-tests/$<' >> $@.tmp; \
|
echo 'Exec=env G_TEST_DATA=$(pkglibexecdir)/installed-tests $(pkglibexecdir)/installed-tests/$<' >> $@.tmp; \
|
||||||
mv $@.tmp $@)
|
mv $@.tmp $@)
|
||||||
|
|
||||||
|
%.desktop.insttest: %.desktop
|
||||||
|
sed -e s,Exec=./appinfo-test,Exec=$(insttestdir)/appinfo-test, < $< >$@.tmp && mv $@.tmp $@
|
||||||
|
|
||||||
|
installed_desktop_test_files = $(desktop_test_files:.desktop=.desktop.insttest)
|
||||||
|
install-data-local: $(installed_desktop_test_files)
|
||||||
|
for x in $(desktop_test_files); do \
|
||||||
|
install -m 0644 $${x}.insttest $(DESTDIR)$(testdatadir)/$$x; \
|
||||||
|
done
|
||||||
|
install -d -m 0755 $(DESTDIR)$(testdatadir)/schema-tests
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <gio/gio.h>
|
#include <gio/gio.h>
|
||||||
#include <gio/gdesktopappinfo.h>
|
#include <gio/gdesktopappinfo.h>
|
||||||
@@ -113,7 +114,7 @@ test_basic (void)
|
|||||||
g_free (path);
|
g_free (path);
|
||||||
|
|
||||||
g_assert_cmpstr (g_app_info_get_id (appinfo), ==, "appinfo-test.desktop");
|
g_assert_cmpstr (g_app_info_get_id (appinfo), ==, "appinfo-test.desktop");
|
||||||
g_assert_cmpstr (g_app_info_get_executable (appinfo), ==, "./appinfo-test");
|
g_assert (strstr (g_app_info_get_executable (appinfo), "appinfo-test") != NULL);
|
||||||
|
|
||||||
icon = g_app_info_get_icon (appinfo);
|
icon = g_app_info_get_icon (appinfo);
|
||||||
g_assert (G_IS_THEMED_ICON (icon));
|
g_assert (G_IS_THEMED_ICON (icon));
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static const gchar *datapath;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_basic (void)
|
test_basic (void)
|
||||||
{
|
{
|
||||||
@@ -79,16 +81,19 @@ test_child (void)
|
|||||||
static void
|
static void
|
||||||
test_type (void)
|
test_type (void)
|
||||||
{
|
{
|
||||||
|
GFile *datapath_f;
|
||||||
GFile *file;
|
GFile *file;
|
||||||
GFileType type;
|
GFileType type;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
file = g_file_new_for_path (SRCDIR "/file.c");
|
datapath_f = g_file_new_for_path (datapath);
|
||||||
|
|
||||||
|
file = g_file_get_child (datapath_f, "g-icon.c");
|
||||||
type = g_file_query_file_type (file, 0, NULL);
|
type = g_file_query_file_type (file, 0, NULL);
|
||||||
g_assert_cmpint (type, ==, G_FILE_TYPE_REGULAR);
|
g_assert_cmpint (type, ==, G_FILE_TYPE_REGULAR);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
|
|
||||||
file = g_file_new_for_path (SRCDIR "/schema-tests");
|
file = g_file_get_child (datapath_f, "schema-tests");
|
||||||
type = g_file_query_file_type (file, 0, NULL);
|
type = g_file_query_file_type (file, 0, NULL);
|
||||||
g_assert_cmpint (type, ==, G_FILE_TYPE_DIRECTORY);
|
g_assert_cmpint (type, ==, G_FILE_TYPE_DIRECTORY);
|
||||||
|
|
||||||
@@ -96,6 +101,8 @@ test_type (void)
|
|||||||
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_IS_DIRECTORY);
|
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_IS_DIRECTORY);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
|
|
||||||
|
g_object_unref (datapath_f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -786,6 +793,11 @@ test_copy_preserve_mode (void)
|
|||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
if (g_getenv ("G_TEST_DATA"))
|
||||||
|
datapath = g_getenv ("G_TEST_DATA");
|
||||||
|
else
|
||||||
|
datapath = SRCDIR;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
|
||||||
g_test_bug_base ("http://bugzilla.gnome.org/");
|
g_test_bug_base ("http://bugzilla.gnome.org/");
|
||||||
|
Reference in New Issue
Block a user