-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathmeson.build
More file actions
59 lines (52 loc) · 1.49 KB
/
meson.build
File metadata and controls
59 lines (52 loc) · 1.49 KB
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
# The tests must be configured with 'b_sanitize=none' for this to work
# unless faketime has been built with sanitizer
faketime = find_program('faketime', required: false)
if faketime.found()
add_test_setup(
'epochalypse',
exe_wrapper: [faketime, '-f', '+14y'],
env: ['RMW_TEST_EPOCHALYPSE=true'],
)
endif
test_cases = ['strings_rmw', 'utils', 'restore']
scripts = [
'test_basic.sh',
'test_media_root.sh',
'test_purging.sh',
'test_restore.sh',
]
if host_sys == 'linux'
if has_statfs and has_linux_fs_header
scripts += ['test_btrfs_clone.sh']
endif
scripts += ['test_bcachefs.sh']
endif
RMW_FAKE_HOME = join_paths(meson.current_build_dir(), 'rmw-tests-home')
foreach case : test_cases
exe = executable(
'test_' + case,
'../src/' + case + '.c',
c_args: ['-DTEST_LIB', '-DRMW_FAKE_HOME="@0@"'.format(RMW_FAKE_HOME)],
dependencies: rmw_dep,
override_options: ['b_lto=false'],
)
test('test_' + case, exe)
endforeach
# Set HOME to the fake home so rmw falls back safely if RMW_FAKE_HOME is ever
# unset mid-script, preventing accidental writes to the real home directory.
test_env = [
'MESON_SOURCE_ROOT=' + meson.project_source_root(),
'RMW_FAKE_HOME=' + RMW_FAKE_HOME,
'HOME=' + RMW_FAKE_HOME,
'XDG_DATA_HOME=' + RMW_FAKE_HOME + '/.local/share',
'XDG_CONFIG_HOME=' + RMW_FAKE_HOME + '/.config',
'MESON_BUILD_ROOT=' + meson.project_build_root(),
]
foreach s : scripts
test(
s,
files(s),
env: test_env,
depends: main_bin,
)
endforeach