From 105524ed96f162b43c0735a65fea284d07356aa2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 22 Jun 2020 19:05:08 +0300 Subject: Adapt to merging of package external tests, examples, and benchmarks into typed tests --- mod/mod-build-task.cxx | 53 ++++++++++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 30 deletions(-) (limited to 'mod/mod-build-task.cxx') diff --git a/mod/mod-build-task.cxx b/mod/mod-build-task.cxx index 741d3b4..04b2a36 100644 --- a/mod/mod-build-task.cxx +++ b/mod/mod-build-task.cxx @@ -228,40 +228,33 @@ handle (request& rq, response& rs) // configuration. // small_vector tes; - auto add_exclusions = [&tes, &cm, this] - (const small_vector& tests) + + for (const build_test_dependency& td: p->tests) { - for (const build_dependency& t: tests) + // Don't exclude unresolved external tests. + // + // Note that this may result in the build task failure. However, + // silently excluding such tests could end up with missed software + // bugs which feels much worse. + // + if (td.package != nullptr) { - // Don't exclude unresolved external tests. - // - // Note that this may result in the build task failure. However, - // silently excluding such tests could end up with missed software - // bugs which feels much worse. - // - if (t.package != nullptr) - { - shared_ptr p (t.package.load ()); + shared_ptr p (td.package.load ()); - // Use the `all` class as a least restrictive default underlying - // build class set. Note that we should only apply the explicit - // build restrictions to the external test packages (think about - // the `builds: all` and `builds: -windows` manifest values for - // the primary and external test packages, respectively). - // - if (exclude (p->builds, - p->constraints, - *cm.config, - nullptr /* reason */, - true /* default_all_ucs */)) - tes.push_back (package {move (p->id.name), move (p->version)}); - } + // Use the `all` class as a least restrictive default underlying + // build class set. Note that we should only apply the explicit + // build restrictions to the external test packages (think about + // the `builds: all` and `builds: -windows` manifest values for + // the primary and external test packages, respectively). + // + if (exclude (p->builds, + p->constraints, + *cm.config, + nullptr /* reason */, + true /* default_all_ucs */)) + tes.push_back (package {move (p->id.name), move (p->version)}); } - }; - - add_exclusions (p->tests); - add_exclusions (p->examples); - add_exclusions (p->benchmarks); + } task_manifest task (move (b->package_name), move (b->package_version), -- cgit v1.1