From 818cde70e20ff897932c4abaca63c446a9ec5561 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 11 Feb 2022 20:10:53 +0300 Subject: Add support for reflect clause in tests package manifest value --- libbrep/build-extra.sql | 3 ++- libbrep/build-package.hxx | 1 + libbrep/build.hxx | 2 +- libbrep/build.xml | 2 ++ libbrep/package.hxx | 27 +++++++++++++++------------ libbrep/package.xml | 6 ++++++ load/load.cxx | 3 ++- mod/mod-build-task.cxx | 3 ++- 8 files changed, 31 insertions(+), 16 deletions(-) diff --git a/libbrep/build-extra.sql b/libbrep/build-extra.sql index a2960ba..2c204e6 100644 --- a/libbrep/build-extra.sql +++ b/libbrep/build-extra.sql @@ -133,7 +133,8 @@ CREATE FOREIGN TABLE build_package_tests ( test_package_version_canonical_release TEXT NULL COLLATE "C", test_package_version_revision INTEGER NULL, test_type TEXT NOT NULL, - test_buildtime BOOLEAN NOT NULL) + test_buildtime BOOLEAN NOT NULL, + test_reflect TEXT NULL) SERVER package_server OPTIONS (table_name 'package_tests'); -- The foreign table for the build_package object builds member (that is of a diff --git a/libbrep/build-package.hxx b/libbrep/build-package.hxx index c46119d..54edc2b 100644 --- a/libbrep/build-package.hxx +++ b/libbrep/build-package.hxx @@ -97,6 +97,7 @@ namespace brep { test_dependency_type type; bool buildtime; + optional reflect; }; // Foreign object that is mapped to a subset of the package object. diff --git a/libbrep/build.hxx b/libbrep/build.hxx index 968a91f..8662cec 100644 --- a/libbrep/build.hxx +++ b/libbrep/build.hxx @@ -30,7 +30,7 @@ // #define LIBBREP_BUILD_SCHEMA_VERSION_BASE 15 -#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 17, closed) +#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 18, closed) // We have to keep these mappings at the global scope instead of inside // the brep namespace because they need to be also effective in the diff --git a/libbrep/build.xml b/libbrep/build.xml index 92b83af..7828df1 100644 --- a/libbrep/build.xml +++ b/libbrep/build.xml @@ -1,4 +1,6 @@ + + diff --git a/libbrep/package.hxx b/libbrep/package.hxx index d0ac23f..8b0613e 100644 --- a/libbrep/package.hxx +++ b/libbrep/package.hxx @@ -20,7 +20,7 @@ // #define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 21 -#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 24, closed) +#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 25, closed) namespace brep { @@ -170,15 +170,15 @@ namespace brep dependency_alternative () = default; dependency_alternative (optional e, - butl::optional r, - butl::optional p, - butl::optional a, - butl::optional q) - : enable (std::move (e)), - reflect (std::move (r)), - prefer (std::move (p)), - accept (std::move (a)), - require (std::move (q)) {} + optional r, + optional p, + optional a, + optional q) + : enable (move (e)), + reflect (move (r)), + prefer (move (p)), + accept (move (a)), + require (move (q)) {} }; #pragma db value @@ -202,15 +202,18 @@ namespace brep { test_dependency_type type; bool buildtime; + optional reflect; test_dependency () = default; test_dependency (package_name n, test_dependency_type t, bool b, - optional c) + optional c, + optional r) : dependency {move (n), move (c), nullptr /* package */}, type (t), - buildtime (b) + buildtime (b), + reflect (move (r)) { } diff --git a/libbrep/package.xml b/libbrep/package.xml index ee177a8..e556f63 100644 --- a/libbrep/package.xml +++ b/libbrep/package.xml @@ -1,4 +1,10 @@ + + + + + + diff --git a/load/load.cxx b/load/load.cxx index ad5379e..691afb6 100644 --- a/load/load.cxx +++ b/load/load.cxx @@ -546,7 +546,8 @@ load_packages (const shared_ptr& rp, ts.emplace_back (move (td.name), td.type, td.buildtime, - move (td.constraint)); + move (td.constraint), + move (td.reflect)); } // Cache before the package name is moved. diff --git a/mod/mod-build-task.cxx b/mod/mod-build-task.cxx index ec937fd..29c048d 100644 --- a/mod/mod-build-task.cxx +++ b/mod/mod-build-task.cxx @@ -275,7 +275,8 @@ handle (request& rq, response& rs) tests.emplace_back (move (td.name), td.type, td.buildtime, - move (td.constraint)); + move (td.constraint), + move (td.reflect)); } bool module_pkg ( -- cgit v1.1