File: meson.build

package info (click to toggle)
zimlib 8.1.1-0.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,592 kB
  • sloc: cpp: 14,011; ansic: 548; python: 241; makefile: 8; sh: 5
file content (60 lines) | stat: -rw-r--r-- 1,714 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
tests = [
    'lrucache',
    'cluster',
    'creator',
    'dirent',
    'error_in_creator',
    'header',
    'uuid',
    'template',
    'archive',
    'iterator',
    'reader',
    'find',
    'compression',
    'dirent_lookup',
    'istreamreader',
    'decoderstreamreader',
    'rawstreamreader',
    'bufferstreamer',
    'parseLongPath',
    'random',
    'tooltesting',
    'tinyString',
    'suggestion_iterator',
    'indexing_criteria',
    'counterParsing'
]

if xapian_dep.found()
    tests += ['search', 'defaultIndexdata', 'search_iterator', 'suggestion']
endif

datadir = get_option('test_data_dir')
if datadir == 'none'
    test_cpp_args = '-DWITH_TEST_DATA=0'
else
    test_cpp_args = '-DWITH_TEST_DATA=1'
    if datadir == ''
        # We need to download the test data.
        datadir = join_paths(meson.current_build_dir(), 'data')
    endif
    run_target('download_test_data', command : [test_data_downloader, '--remove-top-dir', datadir])
endif

testenv = environment()
testenv.set('ZIM_TEST_DATA_DIR', datadir)

if gtest_dep.found() and not meson.is_cross_build()
    foreach test_name : tests
        test_exe = executable(test_name, [test_name+'.cpp', 'tools.cpp'],
                              implicit_include_directories: false,
                              include_directories: [include_directory, src_directory],
                              link_with: libzim,
                              link_args: extra_link_args,
                              cpp_args: test_cpp_args,
                              dependencies: deps + [gtest_dep],
                              build_rpath: '$ORIGIN')
        test(test_name, test_exe, timeout : 120, env: testenv)
    endforeach
endif