meson.build 1.79 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
libtracker_miner_tests = [
    'crawler',
    'file-enumerator',
    'file-notifier',
    'file-system',
    'indexing-tree',
    'priority-queue',
    'task-pool',
    'thumbnailer',
]

libtracker_miner_slow_tests = [
    'miner-fs',
    'monitor',
]

libtracker_miner_test_c_args = [
18 19 20 21
  '-DLIBEXEC_PATH="@0@/@1@"'.format(get_option('prefix'), get_option('libexecdir')),
  '-DTEST',
  '-DTEST_DATA_DIR="@0@/data"'.format(meson.current_source_dir()),
  '-DTEST_MINERS_DIR="@0@/mock-miners"'.format(meson.current_source_dir()),
22
  '-DTEST_ONTOLOGIES_DIR="@0@/src/ontologies/nepomuk"'.format(source_root),
23 24
]

25
libtracker_miner_test_environment = environment()
26
libtracker_miner_test_environment.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', '@0@/src/libtracker-common/stop-words'.format(source_root))
27

28
libtracker_miner_test_deps = [tracker_common_dep, tracker_miner_dep, tracker_sparql_dep]
29

30 31 32 33
foreach base_name: libtracker_miner_tests
    source = 'tracker-@0@-test.c'.format(base_name)
    binary_name = 'tracker-@0@-test'.format(base_name)
    test_name = 'miner-@0@'.format(base_name)
34

35 36
    binary = executable(binary_name, source,
      dependencies: libtracker_miner_test_deps,
37 38
      c_args: libtracker_miner_test_c_args,
      link_with: [libtracker_miner_private])
39

40 41 42
    test(test_name, binary,
      env: libtracker_miner_test_environment)
endforeach
43

44 45 46 47
foreach base_name: libtracker_miner_slow_tests
    source = 'tracker-@0@-test.c'.format(base_name)
    binary_name = 'tracker-@0@-test'.format(base_name)
    test_name = 'miner-@0@'.format(base_name)
48

49 50
    binary = executable(binary_name, source,
      dependencies: libtracker_miner_test_deps,
51 52
      c_args: libtracker_miner_test_c_args,
      link_with: [libtracker_miner_private])
53

54 55 56 57
    test(test_name, binary,
      env: libtracker_miner_test_environment,
      timeout: 180)
endforeach