diff options
author | Benjamin Berg <bberg@redhat.com> | 2018-04-03 19:26:57 +0200 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2018-04-17 15:26:59 +0200 |
commit | b15be07738da3a5bb3bc29376569ac210f5f8519 (patch) | |
tree | fbe2cd4c5e5ecd222197bbaeeb0da871195bad15 | |
parent | 3c76d52e8e5d48c34bb9244829d17903a1007c94 (diff) | |
download | gnome-control-center-b15be07738da3a5bb3bc29376569ac210f5f8519.tar.gz |
Move datetime tests into tests subdirectory
-rw-r--r-- | panels/datetime/meson.build | 23 | ||||
-rw-r--r-- | tests/datetime/meson.build | 26 | ||||
-rw-r--r-- | tests/datetime/test-endianess.c (renamed from panels/datetime/test-endianess.c) | 0 | ||||
-rw-r--r-- | tests/datetime/test-timezone-gfx.c (renamed from panels/datetime/test-timezone-gfx.c) | 3 | ||||
-rw-r--r-- | tests/datetime/test-timezone.c (renamed from panels/datetime/test-timezone.c) | 3 | ||||
-rw-r--r-- | tests/meson.build | 1 |
6 files changed, 35 insertions, 21 deletions
diff --git a/panels/datetime/meson.build b/panels/datetime/meson.build index 8a96844be..5073f263d 100644 --- a/panels/datetime/meson.build +++ b/panels/datetime/meson.build @@ -183,33 +183,14 @@ cflags += [ '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir) ] -panels_libs += static_library( +datetime_panel_lib = static_library( cappletname, sources: sources + resources, include_directories: [ top_inc, common_inc ], dependencies: deps, c_args: cflags ) - -test_cflags = '-DSRCDIR="@0@"'.format(meson.current_source_dir()) - -test_units = [ - #['test-timezone', ['cc-timezone-map.c', 'tz.c'] + resources, [m_dep], []], - ['test-timezone-gfx', ['tz.c'] + resources, [m_dep], [test_cflags]], - ['test-endianess', ['date-endian.c'], [], []] -] - -foreach unit: test_units - exe = executable( - unit[0], - [unit[0] + '.c'] + unit[1], - include_directories: top_inc, - dependencies: deps + unit[2], - c_args: cflags + unit[3] - ) - - test(unit[0], exe) -endforeach +panels_libs += datetime_panel_lib subdir('po-timezones') subdir('icons') diff --git a/tests/datetime/meson.build b/tests/datetime/meson.build new file mode 100644 index 000000000..738651c6d --- /dev/null +++ b/tests/datetime/meson.build @@ -0,0 +1,26 @@ + +test_units = [ + #'test-timezone', + 'test-timezone-gfx', + 'test-endianess', +] + +includes = [top_inc, include_directories('../../panels/datetime')] +cflags = [ + '-DTEST_SRCDIR="@0@"'.format(meson.current_source_dir()), + '-DSRCDIR="@0@"'.format(meson.source_root() + '/panels/datetime') +] + +foreach unit: test_units + exe = executable( + unit, + [unit + '.c'], + include_directories: includes, + dependencies: common_deps + [m_dep], + link_with: [datetime_panel_lib], + c_args: cflags + ) + + test(unit, exe) +endforeach + diff --git a/panels/datetime/test-endianess.c b/tests/datetime/test-endianess.c index 06b26131b..06b26131b 100644 --- a/panels/datetime/test-endianess.c +++ b/tests/datetime/test-endianess.c diff --git a/panels/datetime/test-timezone-gfx.c b/tests/datetime/test-timezone-gfx.c index 2beda3f7c..a8f704627 100644 --- a/panels/datetime/test-timezone-gfx.c +++ b/tests/datetime/test-timezone-gfx.c @@ -1,6 +1,7 @@ #include <config.h> #include <locale.h> +#include "cc-datetime-resources.h" #include "tz.h" static void @@ -46,6 +47,8 @@ int main (int argc, char **argv) g_setenv ("G_DEBUG", "fatal_warnings", FALSE); + g_resources_register (cc_datetime_get_resource ()); + if (argc == 2) { pixmap_dir = g_strdup (argv[1]); } else if (argc == 1) { diff --git a/panels/datetime/test-timezone.c b/tests/datetime/test-timezone.c index ca9860118..436f536b5 100644 --- a/panels/datetime/test-timezone.c +++ b/tests/datetime/test-timezone.c @@ -1,5 +1,6 @@ #include <locale.h> #include <gtk/gtk.h> +#include "cc-datetime-resources.h" #include "cc-timezone-map.h" #define TZ_DIR "/usr/share/zoneinfo/" @@ -100,6 +101,8 @@ int main (int argc, char **argv) gtk_init (NULL, NULL); g_test_init (&argc, &argv, NULL); + g_resources_register (cc_datetime_get_resource ()); + g_setenv ("G_DEBUG", "fatal_warnings", FALSE); g_test_add_func ("/datetime/timezone", test_timezone); diff --git a/tests/meson.build b/tests/meson.build index 91b8d8c68..49229a305 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,3 +1,4 @@ subdir('common') +subdir('datetime') subdir('printers') subdir('info') |