From 047756678a78fb5f39e02de14d3fa1f6179ad028 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 1 Oct 2020 14:15:11 +0300 Subject: Configure main package as a system dependency of test package when required --- bbot/worker/worker.cxx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index 9204d55..1573d0f 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -990,13 +990,14 @@ build (size_t argc, const char* argv[]) // override and/or set the environment variables for bpkg processes. // Return true if all operations for all packages succeed. // - // Note that we assume that these packages belong to the dependent - // package's repository or its complement repositories, recursively. Thus, - // we test them in the configuration used to build the dependent package - // (except for the build system module). + // Pass true as the sys_dep argument to configure the dependent package as + // a system dependency, which is normally required for testing modules and + // installed dependents. Note that bpkg configures the dependent package + // as a special dependency for the test package. // auto test = [&pm, &trace, &wre, &step_args, &config_args, &env_args] (operation_result& r, + bool sys_dep, const char* import = nullptr, const small_vector& envvars = {}) { @@ -1033,7 +1034,8 @@ build (size_t argc, const char* argv[]) step_args (config_args, step_id::bpkg_configure_build), import, "--", - td.string ()); + td.string (), + sys_dep ? ("?sys:" + pm.name.string ()).c_str () : nullptr); if (!r.status) return false; @@ -1113,8 +1115,13 @@ build (size_t argc, const char* argv[]) // Run external tests. // + // Note that we assume that these packages belong to the dependent + // package's repository or its complement repositories, recursively. + // Thus, we test them in the configuration used to build the dependent + // package (except for the build system module). + // if (external_tests && - !test (r, bootstrap ? module_import.c_str () : nullptr)) + !test (r, module, bootstrap ? module_import.c_str () : nullptr)) break; rm.status |= r.status; @@ -1368,7 +1375,7 @@ build (size_t argc, const char* argv[]) // Build/test. // - if (!test (r, nullptr /* import */, envvars)) + if (!test (r, true /* sys_dep */, nullptr /* import */, envvars)) break; } -- cgit v1.1