meson.build 3.07 KB
Newer Older
1
extractor_tests = [
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
  'audio/audio-test-1',
  'audio/empty_albumi_song3',
  'audio/audio-test-2',
  'images/test-image-1',
  'images/xmp-loaded-1',
  'images/test-image-3',
  'images/corrupted-image',
  'images/test-iptcdata-records',
  'images/roi2',
  'images/test-image-4',
  'images/test-image-2',
  'images/comment-extension-block',
  'images/roi',
  'playlists/playlist-test-1',
  'office/office-doc',
  'office/powerpoint',
  'office/pdf-doc',
19 20
  'office/ps-doc',
  'office/ps-doc-atend'
21 22
]

23 24 25 26
if get_option('unzip_ps_gz_files')
  extractor_tests += 'office/psgz-doc'
endif

27 28 29 30 31 32 33
functional_tests = [
  '300-miner-basic-ops',
  '301-miner-resource-removal',
  '310-fts-basic',
  '311-fts-file-operations',
  '312-fts-stopwords',
  '410-extractor-decorator',
34 35 36
  '500-writeback',
  '501-writeback-details',
  '601-applications-sync',
37 38
]

39
# FIXME: this is currently skipped as it doesn't work.
40
# '600-applications-camera',
41

42 43 44 45 46 47 48 49 50

test_runner = find_program('test-runner.sh')

config_json = configure_file(
  input: 'configuration.json.in',
  output: 'configuration.json',
  configuration: conf
)

51 52 53 54 55
detect_h264_codec = join_paths(meson.current_source_dir(), 'detect-h264-codec.sh')
detect_h264_codec_result = run_command(detect_h264_codec)

if detect_h264_codec_result.returncode() == 0
  extractor_tests += [
56 57 58
    'video/184505',
    'video/video-1',
    'video/video-2',
59 60 61 62 63 64 65
  ]
else
  # FIXME: it would be nicer to visibly mark the tests as 'skipped', but the Meson
  # test runner doesn't support this at the moment.
  warning('No GStreamer h264 codec was detected. Some extractor tests will be disabled.')
endif

66 67 68 69 70 71
config_json_full_path = join_paths(meson.current_build_dir(), 'configuration.json')
dconf_profile_full_path = join_paths(meson.current_source_dir(), 'trackertest')
tracker_extractors_dir = join_paths(meson.current_build_dir(), '..', '..', 'src', 'tracker-extract')

test_env = environment()
test_env.set('DCONF_PROFILE', dconf_profile_full_path)
72
test_env.set('GSETTINGS_SCHEMA_DIR', join_paths(meson.build_root(), 'data'))
73

74
test_env.set('TRACKER_DB_ONTOLOGIES_DIR', tracker_uninstalled_nepomuk_ontologies_dir)
75
test_env.set('TRACKER_EXTRACTORS_DIR', tracker_extractors_dir)
76
test_env.set('TRACKER_EXTRACTOR_RULES_DIR', tracker_uninstalled_extract_rules_dir)
77
test_env.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', tracker_uninstalled_stop_words_dir)
78
test_env.set('TRACKER_FUNCTIONAL_TEST_BUILD_DIR', meson.build_root())
79
test_env.set('TRACKER_FUNCTIONAL_TEST_CONFIG', config_json_full_path)
80
test_env.set('TRACKER_TEST_DOMAIN_ONTOLOGY_RULE', tracker_uninstalled_domain_rule)
81
test_env.set('TRACKER_WRITEBACK_MODULES_DIR', tracker_uninstalled_writeback_modules_dir)
82
test_env.set('TRACKER_TESTS_VERBOSE', '1')
83

84 85 86 87 88 89 90 91
foreach t: extractor_tests
  data = join_paths('test-extraction-data', t) + '.expected.json'
  test('functional/extract/' + t, test_runner,
    args: ['./400-extractor-metadata.py', data],
    env: test_env,
    workdir: meson.current_source_dir())
endforeach

92 93 94
foreach t: functional_tests
  test('functional-' + t, test_runner,
    args: './' + t + '.py',
95
    env: test_env,
96
    workdir: meson.current_source_dir(),
97
    timeout: 120)
98
endforeach