File: meson.build

package info (click to toggle)
libaperture-0 0.1.0%2Bgit20221220-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 424 kB
  • sloc: ansic: 2,318; xml: 63; sh: 32; makefile: 9
file content (51 lines) | stat: -rw-r--r-- 1,195 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
test_env = [
  'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
  'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
]

test_sources = files(
  'dummy-device.c',
  'dummy-device-provider.c',

  'main.c',

  'test-barcodes.c',
  'test-camera.c',
  'test-device-manager.c',
  'test-viewfinder.c',

  'utils.c',
)

subdir('data')
test_sources += test_gresources

test_c_args = []
if get_option('barcode_tests_skippable')
  test_c_args += '-DBARCODE_TESTS_SKIPPABLE'
endif

test_executable = executable('aperture-tests',
  test_sources,
  dependencies: libaperture_dep,
  c_args: test_c_args,
  install: true,
)

test('aperture-tests',
  test_executable,
  env: test_env,
)


# We could use the built-in, default coverage reports. However, doing it
# manually here allows us to filter the files, so that only files under src/
# are included.
# Otherwise, the tests themselves, the demo project, and some generated source
# files would skew the results.

# This could also be done using a gcovr.cfg file, but meson will use lcov if
# it's installed, which does not obey that file.
if get_option('b_coverage')
  test_coverage = run_target('test-coverage', command: ['coverage.sh'])
endif