diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-04-02 22:22:46 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-04-05 12:19:51 +0300 |
commit | 6eecad33923ae7052086866756d7e4697fe7bbd3 (patch) | |
tree | fd7997a56806609617c1315001ff4ad669cfb6be /libbbot/manifest.cxx | |
parent | e99fe489d98be215e13aba8e026c953555ef0029 (diff) |
Add support for test-exclude task manifest value
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 ()); |