aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--brep/package8
-rw-r--r--tests/loader/driver.cxx43
2 files changed, 28 insertions, 23 deletions
diff --git a/brep/package b/brep/package
index 252c22f..fd7fb34 100644
--- a/brep/package
+++ b/brep/package
@@ -147,8 +147,8 @@ namespace brep
// dependencies
//
using comparison = bpkg::comparison;
- using dependency_condition = bpkg::dependency_condition;
- #pragma db value(dependency_condition) definition
+ using dependency_constraint = bpkg::dependency_constraint;
+ #pragma db value(dependency_constraint) definition
// Notes:
//
@@ -173,7 +173,7 @@ namespace brep
// just a package but a specific version, so for the same pair of
// packages dependency for different versions can have an opposite
// directions. The possible solution is instead of a package we point
- // to the earliest version that satisfies the condition. But this
+ // to the earliest version that satisfies the constraint. But this
// approach requires to ensure no cycles exist before instantiating
// package objects which in presense of "foreign" packages can be
// tricky. Can stick to just a package name until get some clarity on
@@ -192,7 +192,7 @@ namespace brep
//
using dependency = bpkg::dependency;
#pragma db value(dependency) definition
- #pragma db member(dependency::condition) column("")
+ #pragma db member(dependency::constraint) column("")
using dependency_alternatives = bpkg::dependency_alternatives;
#pragma db value(dependency_alternatives) definition
diff --git a/tests/loader/driver.cxx b/tests/loader/driver.cxx
index 7a78e39..44738e2 100644
--- a/tests/loader/driver.cxx
+++ b/tests/loader/driver.cxx
@@ -30,9 +30,9 @@ using namespace brep;
static inline bool
operator== (const dependency& a, const dependency& b)
{
- return a.name == b.name && !a.condition == !b.condition &&
- (!a.condition || (a.condition->operation == b.condition->operation &&
- a.condition->version == b.condition->version));
+ return a.name == b.name && !a.constraint == !b.constraint &&
+ (!a.constraint || (a.constraint->operation == b.constraint->operation &&
+ a.constraint->version == b.constraint->version));
}
static bool
@@ -183,13 +183,14 @@ main (int argc, char* argv[])
assert (xpv->dependencies[0][0] ==
(dependency {
"libexpat",
- brep::optional<dependency_condition> (
- dependency_condition{comparison::ge, version ("2.0.0")})}));
+ brep::optional<dependency_constraint> (
+ dependency_constraint{
+ comparison::ge, version ("2.0.0")})}));
assert (xpv->dependencies[1].size () == 1);
assert (xpv->dependencies[1][0] ==
(dependency {
- "libgenx", brep::optional<dependency_condition> ()}));
+ "libgenx", brep::optional<dependency_constraint> ()}));
assert (xpv->requirements.empty ());
@@ -244,14 +245,15 @@ main (int argc, char* argv[])
assert (fpv2->dependencies[0][0] ==
(dependency {
"libbar",
- brep::optional<dependency_condition> (
- dependency_condition{comparison::le, version ("2.4.0")})}));
+ brep::optional<dependency_constraint> (
+ dependency_constraint{comparison::le, version ("2.4.0")})}));
assert (fpv2->dependencies[1][0] ==
(dependency {
"libexp",
- brep::optional<dependency_condition> (
- dependency_condition{comparison::eq, version ("1+1.2")})}));
+ brep::optional<dependency_constraint> (
+ dependency_constraint{
+ comparison::eq, version ("1+1.2")})}));
assert (fpv2->requirements.empty ());
@@ -280,8 +282,9 @@ main (int argc, char* argv[])
assert (fpv3->dependencies[0][0] ==
(dependency {
"libmisc",
- brep::optional<dependency_condition> (
- dependency_condition{comparison::ge, version ("2.0.0")})}));
+ brep::optional<dependency_constraint> (
+ dependency_constraint{
+ comparison::ge, version ("2.0.0")})}));
assert (fpv4->name == "libfoo");
assert (fpv4->version == version ("1.2.4"));
@@ -309,8 +312,9 @@ main (int argc, char* argv[])
assert (fpv4->dependencies[0][0] ==
(dependency {
"libmisc",
- brep::optional<dependency_condition> (
- dependency_condition{comparison::ge, version ("2.0.0")})}));
+ brep::optional<dependency_constraint> (
+ dependency_constraint{
+ comparison::ge, version ("2.0.0")})}));
// Verify 'math' repository.
//
@@ -396,14 +400,15 @@ main (int argc, char* argv[])
assert (fpv5->dependencies[0][0] ==
(dependency {
"libmisc",
- brep::optional<dependency_condition> (
- dependency_condition{comparison::lt, version ("1.1")})}));
+ brep::optional<dependency_constraint> (
+ dependency_constraint{comparison::lt, version ("1.1")})}));
assert (fpv5->dependencies[0][1] ==
(dependency {
"libmisc",
- brep::optional<dependency_condition> (
- dependency_condition{comparison::gt, version ("2.3.0")})}));
+ brep::optional<dependency_constraint> (
+ dependency_constraint{
+ comparison::gt, version ("2.3.0")})}));
assert (fpv5->dependencies[1].size () == 1);
assert (fpv5->dependencies[1].comment == "Newer - better.");
@@ -456,7 +461,7 @@ main (int argc, char* argv[])
assert (epv->dependencies[0].size () == 1);
assert (epv->dependencies[0][0] ==
(dependency {
- "libmisc", brep::optional<dependency_condition> ()}));
+ "libmisc", brep::optional<dependency_constraint> ()}));
assert (epv->requirements.empty ());