diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-10-01 14:15:11 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-10-01 17:21:57 +0300 |
commit | 047756678a78fb5f39e02de14d3fa1f6179ad028 (patch) | |
tree | 073be23b625068e8aea766df36010c37657c36c9 | |
parent | 1bffc2c1c23a98661778a50da3fc25a44b1030dd (diff) |
Configure main package as a system dependency of test package when required
-rw-r--r-- | bbot/worker/worker.cxx | 21 |
1 files 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<string, 1>& 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; } |