udevadm-test: show result in json format (#36284)
[systemd.io.git] / hwdb.d / meson.build
blobe7dfd0bea2d5039d7774a3d2b83c7c9ddf423009
1 # SPDX-License-Identifier: LGPL-2.1-or-later
3 # Those files right now are not supported by the grammar. Also,
4 # they are very long but quite repetitive and the parser is not very fast.
5 # So we don't "test" them.
6 hwdb_files_notest = files(
7         'README',
8         '20-dmi-id.hwdb',
9         '20-pci-vendor-model.hwdb',
10         '20-pci-classes.hwdb',
11         '20-usb-vendor-model.hwdb',
12         '20-usb-classes.hwdb',
13         '20-sdio-vendor-model.hwdb',
14         '20-sdio-classes.hwdb',
15         '20-bluetooth-vendor-product.hwdb',
16         '20-acpi-vendor.hwdb',
17         '20-OUI.hwdb',
18         '20-net-ifname.hwdb',
19         '20-vmbus-class.hwdb')
21 hwdb_files_test = files(
22         '60-autosuspend.hwdb',
23         '60-autosuspend-fingerprint-reader.hwdb',
24         '60-evdev.hwdb',
25         '60-input-id.hwdb',
26         '60-keyboard.hwdb',
27         '60-seat.hwdb',
28         '60-sensor.hwdb',
29         '70-analyzers.hwdb',
30         '70-av-production.hwdb',
31         '70-cameras.hwdb',
32         '70-hardware-wallets.hwdb',
33         '70-joystick.hwdb',
34         '70-mouse.hwdb',
35         '70-pda.hwdb',
36         '70-pointingstick.hwdb',
37         '70-sound-card.hwdb',
38         '70-touchpad.hwdb',
39         '80-ieee1394-unit-function.hwdb')
41 if conf.get('ENABLE_HWDB') == 1
42         auto_suspend_rules = custom_target(
43                 '60-autosuspend-chromiumos.hwdb',
44                 output : '60-autosuspend-chromiumos.hwdb',
45                 command : make_autosuspend_rules_py,
46                 capture : true,
47                 install : true,
48                 install_dir: udevhwdbdir,
49                 install_tag: 'hwdb')
51         install_data(hwdb_files_notest,
52                      hwdb_files_test,
53                      install_dir : udevhwdbdir,
54                      install_tag: 'hwdb')
56         if install_sysconfdir
57                 install_emptydir(sysconfdir / 'udev/hwdb.d', install_tag : 'hwdb')
59                 meson.add_install_script(sh, '-c',
60                                          'test -n "$DESTDIR" || @0@/systemd-hwdb update'.format(bindir),
61                                          install_tag: 'hwdb')
62         endif
64         if want_tests != 'false'
65                 parse_hwdb_py = find_program('parse_hwdb.py')
66                 test('parse-hwdb',
67                      parse_hwdb_py,
68                      suite : 'dist',
69                      args : [hwdb_files_test,
70                              auto_suspend_rules],
71                      timeout : 90)
72         endif
73 endif
75 ############################################################
77 run_target(
78         'update-hwdb',
79         command : [update_hwdb_sh, meson.current_source_dir()])
81 run_target(
82         'update-hwdb-autosuspend',
83         command : [update_hwdb_autosuspend_sh, project_source_root])