File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ project(
1313python = import (' python' ).find_installation(' python3' , pure : false )
1414python_dep = python.dependency ()
1515
16+ fs = import (' fs' )
17+
1618libsystemd_dep = dependency (' libsystemd' )
1719
1820add_project_arguments (
@@ -26,4 +28,15 @@ update_constants_py = files('update-constants.py')
2628
2729subdir (' src/systemd' )
2830
31+ test (
32+ ' unit' ,
33+ find_program (python.full_path()),
34+ args : [
35+ ' -m' , ' pytest' ,
36+ ' -v' ,
37+ python_test_dir,
38+ ],
39+ env : { ' PYTHONPATH' : meson .current_build_dir() / ' src' },
40+ )
41+
2942alias_target (' update-constants' , update_constants)
Original file line number Diff line number Diff line change @@ -46,14 +46,19 @@ python.extension_module(
4646)
4747
4848# Install Python modules
49- python.install_sources (
49+ py_files = files (
5050 ' __init__.py' ,
5151 ' journal.py' ,
5252 ' daemon.py' ,
53- subdir : ' systemd' ,
5453)
5554
56- # Install test modules
55+ python.install_sources(py_files, subdir : ' systemd' )
56+ foreach file : py_files
57+ fs.copyfile(file)
58+ endforeach
59+
60+ # Test code
61+ python_test_dir = meson .current_source_dir() / ' test'
5762python.install_sources(
5863 ' test/test_daemon.py' ,
5964 ' test/test_journal.py' ,
@@ -62,10 +67,11 @@ python.install_sources(
6267 subdir : ' systemd/test' ,
6368)
6469
70+ # The 'update-constants' target
6571include_dir = libsystemd_dep.get_variable (pkgconfig : ' includedir' )
6672
6773update_constants = custom_target (
68- output : ' update-constants-impl ' ,
74+ output : ' update-constants' ,
6975 command : [
7076 update_constants_py,
7177 meson .current_source_dir() / ' id128-constants.h' ,
You can’t perform that action at this time.
0 commit comments