From 75845ef500cfc02531a7da80d2f41650f5db9bb1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 10 Feb 2022 20:35:15 +0300 Subject: Add support for reflect clause in tests package manifest value --- libbpkg/manifest.hxx | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'libbpkg/manifest.hxx') diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx index 6428e3a..94206f3 100644 --- a/libbpkg/manifest.hxx +++ b/libbpkg/manifest.hxx @@ -1021,27 +1021,31 @@ namespace bpkg { test_dependency_type type; bool buildtime; + butl::optional reflect; test_dependency () = default; test_dependency (package_name n, test_dependency_type t, bool b, - butl::optional c) - : dependency {std::move (n), std::move (c)}, type (t), buildtime (b) {} + butl::optional c, + butl::optional r) + : dependency {std::move (n), std::move (c)}, + type (t), + buildtime (b), + reflect (std::move (r)) {} // Parse the test dependency string representation in the - // `[*] []` form. Throw std::invalid_argument - // if the value is invalid. + // `[*] [] []` form. Throw + // std::invalid_argument if the value is invalid. + // + // Verify that the reflect clause, if present, refers to the test + // dependency package configuration variable. Note that such variable + // value normally signals the dependent package being tested. // test_dependency (std::string, test_dependency_type); - inline std::string - string () const - { - return buildtime - ? "* " + dependency::string () - : dependency::string (); - } + std::string + string () const; }; class LIBBPKG_EXPORT package_manifest -- cgit v1.1