summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-19 09:17:58 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-23 10:32:42 +0200
commitb85e54961ce9f84cc978341dc5b69a62f2bb98b3 (patch)
treebf24f25d6830f6d8cc91dc10227094b177fdb4c4 /meson.build
parentmkosi: Deal with ubuntu's special debug packages (diff)
downloadsystemd-b85e54961ce9f84cc978341dc5b69a62f2bb98b3.tar.xz
systemd-b85e54961ce9f84cc978341dc5b69a62f2bb98b3.zip
test: Various mkosi integration test improvements
- Stop using logging module since the default output formatting is pretty bad. Prefer print() for now. - Log less, logging the full mkosi command line is rather verbose, especially when it contains multi-line dropins. - Streamline the journalctl command we output for debugging failed tests. - Don't force usage of the disk image format. - Don't force running without unit tests. - Don't force disabling RuntimeBuildSources. - Update documentation to streamline the command for running a single test and remove sudo as it's not required anymore. - Improve the console output by having the test unit's output logged to both the journal and the console. - Disable journal console log forwarding as we have journal forwarding as a better alternative. - Delete existing journal file before running test. - Delete journal files of succeeded tests to reduce disk usage. - Rename system_mkosi target to just mkosi - Pass in mkosi source directory explicitly to accomodate arbitrary build directory locations. - Add test interactive debugging if stdout is connected to a tty - Stop explicitly using the 'system' image since it'll likely be dropped soon. - Only forward journal if we're not running in debugging mode. - Stop using testsuite.target and instead just add the necessary extras to the main testsuite unit via the credential dropin. - Override type to idle so test output is not interleaved with status output. - Don't build mkosi target by default - Always add the mkosi target if mkosi is found - Remove dependency of the integration tests on the mkosi target as otherwise the image is always built, even though we configure it to not be built by default. - Move mkosi output, cache and build directory into build/ so that invocations from meson and regular invocations share the same directories. - Various aesthetic cleanups.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build24
1 files changed, 19 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index e2de148095..6397ee2e64 100644
--- a/meson.build
+++ b/meson.build
@@ -2573,13 +2573,27 @@ endif
#####################################################################
-if get_option('integration-tests') != false
- system_mkosi = custom_target('system_mkosi',
+mkosi = find_program('mkosi', required : false)
+if mkosi.found()
+ custom_target('mkosi',
build_always_stale : true,
- output : 'system',
+ build_by_default: false,
console : true,
- command : ['mkosi', '-C', meson.project_source_root(), '--image=system', '--format=disk', '--output-dir', meson.project_build_root() / '@OUTPUT@', '--without-tests', '-fi', 'build'],
- depends : [executables_by_name['bootctl'], executables_by_name['systemd-measure'], executables_by_name['systemd-repart'], ukify],
+ output : '.',
+ command : [
+ 'mkosi',
+ '--directory', meson.current_source_dir(),
+ '--output-dir', meson.current_build_dir() / 'mkosi.output',
+ '--cache-dir', meson.current_build_dir() / 'mkosi.cache',
+ '--build-dir', meson.current_build_dir() / 'mkosi.builddir',
+ '--force',
+ 'build'
+ ],
+ depends : public_programs + [
+ executables_by_name['systemd-journal-remote'],
+ executables_by_name['systemd-measure'],
+ ukify,
+ ],
)
endif