Move datetime tests into tests subdirectory
This commit is contained in:
@@ -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')
|
||||
|
||||
26
tests/datetime/meson.build
Normal file
26
tests/datetime/meson.build
Normal file
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
@@ -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);
|
||||
@@ -1,3 +1,4 @@
|
||||
subdir('common')
|
||||
subdir('datetime')
|
||||
subdir('printers')
|
||||
subdir('info')
|
||||
|
||||
Reference in New Issue
Block a user