Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ project(
python = import('python').find_installation('python3', pure: false)
python_dep = python.dependency()

fs = import('fs')

libsystemd_dep = dependency('libsystemd')

add_project_arguments(
Expand All @@ -26,4 +28,15 @@ update_constants_py = files('update-constants.py')

subdir('src/systemd')

test(
'unit',
find_program(python.full_path()),
args: [
'-m', 'pytest',
'-v',
python_test_dir,
],
env: { 'PYTHONPATH': meson.current_build_dir() / 'src' },
)

alias_target('update-constants', update_constants)
14 changes: 10 additions & 4 deletions src/systemd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,19 @@ python.extension_module(
)

# Install Python modules
python.install_sources(
py_files = files(
'__init__.py',
'journal.py',
'daemon.py',
subdir: 'systemd',
)

# Install test modules
python.install_sources(py_files, subdir: 'systemd')
foreach file: py_files
fs.copyfile(file)
endforeach

# Test code
python_test_dir = meson.current_source_dir() / 'test'
python.install_sources(
'test/test_daemon.py',
'test/test_journal.py',
Expand All @@ -62,10 +67,11 @@ python.install_sources(
subdir: 'systemd/test',
)

# The 'update-constants' target
include_dir = libsystemd_dep.get_variable(pkgconfig: 'includedir')

update_constants = custom_target(
output: 'update-constants-impl',
output: 'update-constants',
command: [
update_constants_py,
meson.current_source_dir() / 'id128-constants.h',
Expand Down