diff options
Diffstat (limited to 'libbbot/manifest.cxx')
-rw-r--r-- | libbbot/manifest.cxx | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/libbbot/manifest.cxx b/libbbot/manifest.cxx index df74225..c01a84b 100644 --- a/libbbot/manifest.cxx +++ b/libbbot/manifest.cxx @@ -521,6 +521,38 @@ namespace bbot trust.emplace_back (move (v)); } + else if (n == "test-exclude") + { + size_t p (v.find ('/')); + if (p == string::npos) + bad_value ("invalid test exclusion package: '/' is expected"); + + package_name pn; + + try + { + pn = package_name (string (v, 0, p)); + } + catch (const invalid_argument& e) + { + bad_value (string ("invalid test exclusion package name: ") + + e.what ()); + } + + bpkg::version pv; + + try + { + pv = bpkg::version (string (v, p + 1)); + } + catch (const invalid_argument& e) + { + bad_value (string ("invalid test exclusion package version: ") + + e.what ()); + } + + test_exclusions.push_back (package {move (pn), move (pv)}); + } else if (n == "machine") { if (!machine.empty ()) @@ -637,9 +669,12 @@ namespace bbot // s.next ("repository-url", repository.string ()); - for (const auto& v: trust) + for (const string& v: trust) s.next ("trust", v); + for (const package& te: test_exclusions) + s.next ("test-exclude", te.name.string () + '/' + te.version.string ()); + s.next ("machine", machine); s.next ("target", target.string ()); |