File: meson.build

package info (click to toggle)
gtk4-layer-shell 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 852 kB
  • sloc: ansic: 5,701; python: 421; xml: 417; makefile: 10
file content (55 lines) | stat: -rw-r--r-- 1,842 bytes parent folder | download
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
subdir('test-common')
subdir('mock-server')
subdir('integration-test-common')
subdir('layer-tests')
subdir('lock-tests')
subdir('unit-tests')

py = find_program('python3')
run_test_script = files(meson.current_source_dir() + '/run-integration-test.py')

env = [
    'GTKLS_BUILD_DIR=' + meson.build_root(),
    # Prevent GTK from talking to dbus/xdg desktop portal, which can be a bottleneck when runnning tests in parallel
    'DBUS_SESSION_BUS_ADDRESS=FUCK_DBUS',
]

foreach test_list : [['layer', layer_tests], ['lock', lock_tests]]
    test_prefix = test_list[0]
    test_dir = test_prefix + '-tests'
    foreach test_name : test_list[1]
        test_full_name = test_prefix + '-' + test_name
        exe = executable(
            test_full_name,
            files(join_paths(test_dir, test_name + '.c')), client_protocol_srcs,
            dependencies: [gtk, wayland_client, gtk_layer_shell, integration_test_common])
        test(
            test_full_name,
            py,
            workdir: meson.current_source_dir(),
            env: env,
            timeout: 120,
            args: [
                run_test_script,
                meson.current_build_dir() + '/' + test_full_name,
            ])
    endforeach
endforeach

if get_option('smoke-tests')
    subdir('smoke-tests')
    foreach smoke_test : smoke_tests
        test(
            'smoke-' + smoke_test,
            py,
            workdir: meson.current_source_dir(),
            env: env + ['GTKLS_VALGRIND=0'],
            args: [
                run_test_script,
                meson.current_source_dir() + '/smoke-tests/' + smoke_test + '.py',
            ])
    endforeach
endif

check_tests_in_meson_script = files(meson.current_source_dir() + '/check-all-tests-are-in-meson.py')
test('check-all-tests-are-in-meson', py, args: [check_tests_in_meson_script])