@@ -321,6 +321,7 @@ meson_build_sh = find_program('tools/meson-build.sh')
321321want_tests = get_option (' tests' )
322322slow_tests = want_tests != ' false' and get_option (' slow-tests' )
323323fuzz_tests = want_tests != ' false' and get_option (' fuzz-tests' )
324+ integration_tests = want_tests != ' false' and get_option (' integration-tests' )
324325install_tests = want_tests != ' false' and get_option (' install-tests' )
325326
326327if add_languages (' cpp' , native : false , required : fuzzer_build)
@@ -2574,6 +2575,18 @@ endif
25742575#####################################################################
25752576
25762577mkosi = find_program (' mkosi' , required : false )
2578+ if integration_tests and not mkosi.found()
2579+ error (' Could not find mkosi which is required to run the integration tests' )
2580+ endif
2581+
2582+ mkosi_depends = public_programs
2583+
2584+ foreach executable : [' systemd-journal-remote' , ' systemd-measure' ]
2585+ if executable in executables_by_name
2586+ mkosi_depends += [executables_by_name[executable]]
2587+ endif
2588+ endforeach
2589+
25772590if mkosi.found()
25782591 custom_target (' mkosi' ,
25792592 build_always_stale : true ,
@@ -2588,13 +2601,9 @@ if mkosi.found()
25882601 ' --build-dir' , meson .current_build_dir() / ' mkosi.builddir' ,
25892602 ' --force' ,
25902603 ' --debug' ,
2591- ' build'
2592- ],
2593- depends : public_programs + [
2594- executables_by_name[' systemd-journal-remote' ],
2595- executables_by_name[' systemd-measure' ],
2596- ukify,
2604+ ' build' ,
25972605 ],
2606+ depends : mkosi_depends,
25982607 )
25992608endif
26002609
0 commit comments