Commit 0fb5fe2e authored by Sam Thursfield's avatar Sam Thursfield

meson: Rework how tests are defined

The list of tests is now at the top of each meson.build file, so it's
harder to miss them out by mistake.

Corresponds with tracker!5
parent 13d6c981
Pipeline #19613 passed with stage
in 5 minutes and 21 seconds
......@@ -375,6 +375,11 @@ if get_option('docs')
subdir('docs')
endif
test_c_args = tracker_c_args + [
'-DTOP_BUILDDIR="@0@/"'.format(meson.build_root()),
'-DTOP_SRCDIR="@0@/"'.format(meson.source_root()),
]
subdir('tests')
subdir('po')
......
test_c_args = tracker_c_args + [
'-DTOP_BUILDDIR="@0@/"'.format(meson.build_root()),
'-DTOP_SRCDIR="@0@/"'.format(meson.source_root()),
libtracker_extract_tests = [
'extract-info',
'guarantee',
'utils',
'xmp',
]
guarantee_test = executable('tracker-guarantee-test',
'tracker-guarantee-test.c',
dependencies: [tracker_miners_common_dep, tracker_extract_dep],
c_args: test_c_args,
)
test('extract-guarantee', guarantee_test)
if charset_library_name != 'none'
libtracker_extract_tests += ['encoding']
endif
extract_info_test = executable('tracker-extract-info-test',
'tracker-extract-info-test.c',
dependencies: [tracker_miners_common_dep, tracker_extract_dep],
c_args: test_c_args,
)
test('extract-info-test', extract_info_test)
if libexif.found()
libtracker_extract_tests += ['exif']
endif
utils_test = executable('tracker-utils-test',
'tracker-utils-test.c',
dependencies: [tracker_miners_common_dep, tracker_extract_dep],
c_args: test_c_args,
)
test('extract-utils', utils_test)
libtracker_extract_test_deps = [
tracker_miners_common_dep, tracker_extract_dep
]
xmp_test = executable('tracker-xmp-test',
'tracker-xmp-test.c',
dependencies: [tracker_miners_common_dep, tracker_extract_dep],
c_args: test_c_args,
)
test('extract-xmp', xmp_test)
foreach base_name: libtracker_extract_tests
source = 'tracker-@0@-test.c'.format(base_name)
binary_name = 'tracker-@0@-test'.format(base_name)
test_name = 'extract-@0@'.format(base_name)
if libexif.found()
exif_test = executable('tracker-exif-test',
'tracker-exif-test.c',
dependencies: [tracker_miners_common_dep, tracker_extract_dep],
c_args: test_c_args,
)
test('extract-exif', exif_test)
endif
binary = executable(binary_name, source,
dependencies: libtracker_extract_test_deps,
c_args: test_c_args)
test(test_name, binary)
endforeach
if libiptcdata.found() and libjpeg.found()
iptc_test = executable('tracker-iptc-test',
'tracker-iptc-test.c',
dependencies: [tracker_miners_common_dep, tracker_extract_dep, libjpeg],
dependencies: libtracker_extract_test_deps + [libjpeg],
c_args: test_c_args,
)
test('extract-iptc', iptc_test)
endif
if charset_library_name != 'none'
encoding_test = executable('tracker-encoding-test',
'tracker-encoding-test.c',
dependencies: [tracker_miners_common_dep, tracker_extract_dep],
c_args: test_c_args,
)
test('extract-encoding', encoding_test)
endif
test_c_args = tracker_c_args + [
'-DTOP_BUILDDIR="@0@"'.format(meson.build_root()),
'-DTOP_SRCDIR="@0@"'.format(meson.source_root()),
libtracker_common_tests = [
'date-time',
'dbus',
'file-utils',
'sched',
'type-utils',
'utils',
]
date_time_test = executable('tracker-date-time-test',
'tracker-date-time-test.c',
dependencies: tracker_miners_common_dep,
c_args: test_c_args,
)
test('common-date-time', date_time_test)
dbus_test = executable('tracker-dbus-test',
'tracker-dbus-test.c',
dependencies: [tracker_miners_common_dep, tracker_testcommon_dep],
c_args: test_c_args,
)
test('common-dbus', dbus_test)
file_utils_test = executable('tracker-file-utils-test',
'tracker-file-utils-test.c',
dependencies: [tracker_miners_common_dep, tracker_testcommon_dep],
c_args: test_c_args,
)
test('common-file-utils', file_utils_test)
libtracker_miners_common_test_deps = [
tracker_miners_common_dep, tracker_testcommon_dep
]
sched_test = executable('tracker-sched-test',
'tracker-sched-test.c',
dependencies: [tracker_miners_common_dep, tracker_testcommon_dep],
c_args: test_c_args,
)
test('common-sched', sched_test)
foreach base_name: libtracker_common_tests
source = 'tracker-@0@-test.c'.format(base_name)
binary_name = 'tracker-@0@-test'.format(base_name)
test_name = 'miners-common-@0@'.format(base_name)
type_utils_test = executable('tracker-type-utils-test',
'tracker-type-utils-test.c',
dependencies: tracker_miners_common_dep,
c_args: test_c_args,
)
test('common-type-utils', type_utils_test)
binary = executable(binary_name, source,
dependencies: libtracker_miners_common_test_deps,
c_args: test_c_args)
utils_test = executable('tracker-utils-test',
'tracker-utils-test.c',
dependencies: tracker_miners_common_dep,
c_args: test_c_args,
)
test('common-utils', utils_test)
test(test_name, binary)
endforeach
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment