aboutsummaryrefslogtreecommitdiff
path: root/libbpkg/manifest.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-08-19 21:21:32 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-08-19 21:22:28 +0300
commit724b68d96bb69685b0b878916e4cb89b3368705b (patch)
tree0baced5f9a08190b03e3ad7c3753a4013af50d96 /libbpkg/manifest.cxx
parent0592d58e5366eac92bc99ef9bdb4368e07c0ddf9 (diff)
Add support for build-time mark (*) in tests, examples, and benchmarks package manifest values
Diffstat (limited to 'libbpkg/manifest.cxx')
-rw-r--r--libbpkg/manifest.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/libbpkg/manifest.cxx b/libbpkg/manifest.cxx
index d4c3f9d..8631d18 100644
--- a/libbpkg/manifest.cxx
+++ b/libbpkg/manifest.cxx
@@ -2340,17 +2340,27 @@ namespace bpkg
// Parse the test dependencies.
//
- for (name_value& v: tests)
+ for (name_value& t: tests)
{
- nv = move (v); // Restore as bad_value() uses its line/column.
+ nv = move (t); // Restore as bad_value() uses its line/column.
- dependency d (parse_dependency (move (nv.value), nv.name.c_str ()));
+ string& v (nv.value);
+
+ bool b (v[0] == '*');
+ size_t p (v.find_first_not_of (spaces, b ? 1 : 0));
+
+ if (p == string::npos)
+ bad_value ("no " + nv.name + " package name specified");
+
+ dependency d (parse_dependency (p == 0 ? move (v) : string (v, p),
+ nv.name.c_str ()));
try
{
m.tests.emplace_back (
move (d.name),
to_test_dependency_type (nv.name),
+ b,
move (d.constraint));
}
catch (const invalid_argument&)