From 9e1700cbfeaaa751fb5a0d385d6ea18d69a5ac1c Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 14 Mar 2015 17:58:03 +0200 Subject: [PATCH] Moved different gnome feature tests in their own subdirectories. --- modules/gnome.py | 2 +- .../frameworks/7 gnome/{ => gir}/golib.c | 0 .../frameworks/7 gnome/{ => gir}/golib.h | 0 test cases/frameworks/7 gnome/gir/meson.build | 15 +++++++++ .../frameworks/7 gnome/{ => gir}/prog.c | 0 test cases/frameworks/7 gnome/meson.build | 32 ++----------------- .../7 gnome/{ => resources}/data/res1.txt | 0 .../frameworks/7 gnome/{ => resources}/main.c | 0 .../frameworks/7 gnome/resources/meson.build | 7 ++++ .../{ => resources}/myresource.gresource.xml | 0 .../com.github.meson.gschema.xml | 0 .../frameworks/7 gnome/schemas/meson.build | 8 +++++ .../7 gnome/{ => schemas}/schemaprog.c | 2 +- 13 files changed, 35 insertions(+), 31 deletions(-) rename test cases/frameworks/7 gnome/{ => gir}/golib.c (100%) rename test cases/frameworks/7 gnome/{ => gir}/golib.h (100%) create mode 100644 test cases/frameworks/7 gnome/gir/meson.build rename test cases/frameworks/7 gnome/{ => gir}/prog.c (100%) rename test cases/frameworks/7 gnome/{ => resources}/data/res1.txt (100%) rename test cases/frameworks/7 gnome/{ => resources}/main.c (100%) create mode 100644 test cases/frameworks/7 gnome/resources/meson.build rename test cases/frameworks/7 gnome/{ => resources}/myresource.gresource.xml (100%) rename test cases/frameworks/7 gnome/{ => schemas}/com.github.meson.gschema.xml (100%) create mode 100644 test cases/frameworks/7 gnome/schemas/meson.build rename test cases/frameworks/7 gnome/{ => schemas}/schemaprog.c (94%) diff --git a/modules/gnome.py b/modules/gnome.py index a1c502515..f6d13a952 100644 --- a/modules/gnome.py +++ b/modules/gnome.py @@ -26,7 +26,7 @@ class GnomeModule: def compile_resources(self, state, args, kwargs): cmd = ['glib-compile-resources', '@INPUT@', '--generate'] if 'source_dir' in kwargs: - d = os.path.join(state.build_to_src, kwargs.pop('source_dir')) + d = os.path.join(state.build_to_src, state.subdir, kwargs.pop('source_dir')) cmd += ['--sourcedir', d] if 'c_name' in kwargs: cmd += ['--c-name', kwargs.pop('c_name')] diff --git a/test cases/frameworks/7 gnome/golib.c b/test cases/frameworks/7 gnome/gir/golib.c similarity index 100% rename from test cases/frameworks/7 gnome/golib.c rename to test cases/frameworks/7 gnome/gir/golib.c diff --git a/test cases/frameworks/7 gnome/golib.h b/test cases/frameworks/7 gnome/gir/golib.h similarity index 100% rename from test cases/frameworks/7 gnome/golib.h rename to test cases/frameworks/7 gnome/gir/golib.h diff --git a/test cases/frameworks/7 gnome/gir/meson.build b/test cases/frameworks/7 gnome/gir/meson.build new file mode 100644 index 000000000..115631e01 --- /dev/null +++ b/test cases/frameworks/7 gnome/gir/meson.build @@ -0,0 +1,15 @@ + +libsources = ['golib.c', 'golib.h'] + +girexe = executable('girprog', libsources, 'prog.c', +dependencies : [glib, gobj, gir, gmod]) + +gnome.generate_gir(girexe, +sources : libsources, +nsversion : '1.0', +namespace : 'Meson', +install : true, +install_dir : 'typelibdir', +) + +test('gobject introspection', girexe) diff --git a/test cases/frameworks/7 gnome/prog.c b/test cases/frameworks/7 gnome/gir/prog.c similarity index 100% rename from test cases/frameworks/7 gnome/prog.c rename to test cases/frameworks/7 gnome/gir/prog.c diff --git a/test cases/frameworks/7 gnome/meson.build b/test cases/frameworks/7 gnome/meson.build index 957e8abce..4a45e62b9 100644 --- a/test cases/frameworks/7 gnome/meson.build +++ b/test cases/frameworks/7 gnome/meson.build @@ -7,33 +7,7 @@ gobj = dependency('gobject-2.0') gir = dependency('gobject-introspection-1.0') gmod = dependency('gmodule-2.0') -myres = gnome.compile_resources('myresources', 'myresource.gresource.xml', -source_dir : 'data', -c_name : 'myres') +subdir('resources') +subdir('gir') +subdir('schemas') -resexe = executable('resprog', 'main.c', myres, -dependencies : gio) -test('resource test', resexe) - -libsources = ['golib.c', 'golib.h'] - -girexe = executable('girprog', libsources, 'prog.c', -dependencies : [glib, gobj, gir, gmod]) - -gnome.generate_gir(girexe, -sources : libsources, -nsversion : '1.0', -namespace : 'Meson', -install : true, -install_dir : 'typelibdir', -) - -test('gobject introspection', girexe) - -gnome.compile_schemas() -install_data('com.github.meson.gschema.xml', -install_dir : 'share/glib-2.0/schemas') - -schemaexe = executable('schemaprog', 'schemaprog.c', -dependencies : gio) -test('schema test', schemaexe) diff --git a/test cases/frameworks/7 gnome/data/res1.txt b/test cases/frameworks/7 gnome/resources/data/res1.txt similarity index 100% rename from test cases/frameworks/7 gnome/data/res1.txt rename to test cases/frameworks/7 gnome/resources/data/res1.txt diff --git a/test cases/frameworks/7 gnome/main.c b/test cases/frameworks/7 gnome/resources/main.c similarity index 100% rename from test cases/frameworks/7 gnome/main.c rename to test cases/frameworks/7 gnome/resources/main.c diff --git a/test cases/frameworks/7 gnome/resources/meson.build b/test cases/frameworks/7 gnome/resources/meson.build new file mode 100644 index 000000000..937dc478d --- /dev/null +++ b/test cases/frameworks/7 gnome/resources/meson.build @@ -0,0 +1,7 @@ +myres = gnome.compile_resources('myresources', 'myresource.gresource.xml', +source_dir : 'data', +c_name : 'myres') + +resexe = executable('resprog', 'main.c', myres, +dependencies : gio) +test('resource test', resexe) diff --git a/test cases/frameworks/7 gnome/myresource.gresource.xml b/test cases/frameworks/7 gnome/resources/myresource.gresource.xml similarity index 100% rename from test cases/frameworks/7 gnome/myresource.gresource.xml rename to test cases/frameworks/7 gnome/resources/myresource.gresource.xml diff --git a/test cases/frameworks/7 gnome/com.github.meson.gschema.xml b/test cases/frameworks/7 gnome/schemas/com.github.meson.gschema.xml similarity index 100% rename from test cases/frameworks/7 gnome/com.github.meson.gschema.xml rename to test cases/frameworks/7 gnome/schemas/com.github.meson.gschema.xml diff --git a/test cases/frameworks/7 gnome/schemas/meson.build b/test cases/frameworks/7 gnome/schemas/meson.build new file mode 100644 index 000000000..b4765b6ec --- /dev/null +++ b/test cases/frameworks/7 gnome/schemas/meson.build @@ -0,0 +1,8 @@ + +gnome.compile_schemas() +install_data('com.github.meson.gschema.xml', +install_dir : 'share/glib-2.0/schemas') + +schemaexe = executable('schemaprog', 'schemaprog.c', +dependencies : gio) +test('schema test', schemaexe) diff --git a/test cases/frameworks/7 gnome/schemaprog.c b/test cases/frameworks/7 gnome/schemas/schemaprog.c similarity index 94% rename from test cases/frameworks/7 gnome/schemaprog.c rename to test cases/frameworks/7 gnome/schemas/schemaprog.c index 51bfbd96d..17dab6514 100644 --- a/test cases/frameworks/7 gnome/schemaprog.c +++ b/test cases/frameworks/7 gnome/schemas/schemaprog.c @@ -9,7 +9,7 @@ int main(int argc, char **argv) { GVariant *value; GError *error = NULL; - src = g_settings_schema_source_new_from_directory(".", + src = g_settings_schema_source_new_from_directory("schemas", g_settings_schema_source_get_default(), TRUE, &error); if(error) { fprintf(stderr, "Fail: %s\n", error->message);