aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-build-task.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-01 21:50:16 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-06 18:42:14 +0300
commitf11d8c32c01ab1ac13268484b9e85732176a47d9 (patch)
tree960473ad9016458dde5f8a092b9715c77888aaac /mod/mod-build-task.cxx
parentca708a3f172e2f0ffab8638087b3e478de06b996 (diff)
Add support for test-exclude task manifest value
Diffstat (limited to 'mod/mod-build-task.cxx')
-rw-r--r--mod/mod-build-task.cxx42
1 files changed, 36 insertions, 6 deletions
diff --git a/mod/mod-build-task.cxx b/mod/mod-build-task.cxx
index edddb89..3eaa0d3 100644
--- a/mod/mod-build-task.cxx
+++ b/mod/mod-build-task.cxx
@@ -220,14 +220,44 @@ handle (request& rq, response& rs)
lazy_shared_ptr<build_repository> r (p->internal_repository);
- strings fp;
+ strings fps;
if (r->certificate_fingerprint)
- fp.emplace_back (move (*r->certificate_fingerprint));
+ fps.emplace_back (move (*r->certificate_fingerprint));
+
+ // Exclude external test packages which exclude the task build
+ // configuration.
+ //
+ small_vector<package, 1> tes;
+ auto add_exclusions = [&tes, &cm, this]
+ (const small_vector<build_dependency, 1>& 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 (t.package != nullptr)
+ {
+ shared_ptr<build_package> p (t.package.load ());
+
+ if (exclude (p->builds, p->constraints, *cm.config))
+ 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),
move (r->location),
- move (fp),
+ move (fps),
+ move (tes),
cm.machine->name,
cm.config->target,
cm.config->environment,
@@ -595,7 +625,7 @@ handle (request& rq, response& rs)
//
// We iterate over buildable packages.
//
- assert (p->internal_repository != nullptr);
+ assert (p->internal ());
p->internal_repository.load ();
@@ -677,8 +707,8 @@ handle (request& rq, response& rs)
shared_ptr<build_package> p (
build_db_->find<build_package> (b->id.package));
- if (p != nullptr &&
- p->internal_repository != nullptr &&
+ if (p != nullptr &&
+ p->internal () &&
!exclude (p->builds, p->constraints, *cm.config))
{
assert (b->status);