Debian Codegraph @

tests/pam/meson.build

raw
1 subdir('services')
2
3 tests = [
4 'test_pam_fprintd',
5 ]
6
7 preloaded_libs = []
8 pam_tests_ld_preload = []
9
10 if address_sanitizer
11 # ASAN has to be the first in list
12 preloaded_libs += 'asan'
13 endif
14
15 if pam_wrapper_dep.found()
16 preloaded_libs += 'pam_wrapper'
17 endif
18
19 foreach libname: preloaded_libs
20 lib = run_command(meson.get_compiler('c'),
21 '-print-file-name=lib@[email protected]'.format(libname),
22 check: false,
23 ).stdout().strip()
24
25 # Support linker script files
26 if run_command('grep', '-qI', '^INPUT', files(lib), check: false).returncode() == 0
27 out = run_command('cat', lib).stdout()
28 lib = out.split('(')[1].split(')')[0].strip()
29 endif
30
31 if lib != '' and lib[0] == '/'
32 message('Found library @0@ as @1@'.format(libname, lib))
33 preload_lib_path = files(lib)[0]
34 if meson.version().version_compare('>=1.4')
35 pam_tests_ld_preload += preload_lib_path.full_path()
36 else
37 pam_tests_ld_preload += '@0@'.format(preload_lib_path)
38 endif
39 else
40 tests = []
41 warning('No library found for ' + libname + ', skipping PAM tests')
42 endif
43 endforeach
44
45 foreach t: tests
46 python_tests += [
47 {
48 'name': t,
49 'file': files(meson.current_source_dir() / t + '.py')[0],
50 'is_parallel': false,
51 'env': [
52 'TOPBUILDDIR=' + meson.project_build_root(),
53 'TOPSRCDIR=' + meson.project_source_root(),
54 'LD_PRELOAD=' + ' '.join(pam_tests_ld_preload),
55 'PAM_WRAPPER=1',
56 'PAM_WRAPPER_DEBUGLEVEL=2',
57 'PAM_WRAPPER_SERVICE_DIR=' + meson.current_build_dir() / 'services',
58 'G_DEBUG=fatal-warnings',
59 ],
60 'depends': [
61 pam_fprintd,
62 pam_service_file,
63 ],
64 'suite': ['PAM'],
65 }
66 ]
67 endforeach