libei/proto/meson.build
Peter Hutterer ca06927371 test: add some tests for the ei-scanner itself
This is a bit convoluted because ei-scanner is named like that, so it
cannot be imported as python module. The solution for that is to
copy/rename it with meson to the builddir and run pytest in that. This
also allows us to set the path to the protocol XML file while we're at
it so we can use it as a fixture.

Actual tests are minimal for now, can be extended over time.
2023-05-22 10:54:28 +10:00

17 lines
600 B
Meson

scanner_source = files('ei-scanner')
scanner = find_program(scanner_source)
protocol_xml_path = meson.current_source_dir() / 'protocol.xml'
protocol_dtd_path = meson.current_source_dir() / 'protocol.dtd'
protocol_xml = files(protocol_xml_path)
protocol_dtd = files(protocol_dtd_path)
xmllint = find_program('xmllint', required: false)
if xmllint.found()
test('dtdcheck', xmllint,
args: ['--dtdvalid', protocol_dtd, protocol_xml]
)
endif
pymod = import('python')
required_python_modules = ['attr', 'jinja2']
pymod.find_installation('python3', modules: required_python_modules)