aboutsummaryrefslogtreecommitdiff
path: root/tests/load/driver.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-07-06 20:28:22 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-07-10 21:38:45 +0300
commit4b9be1cb87c4759ca08aa89acd9e9fd7ba5b18be (patch)
tree6a591f70c02cee552d6b97abc5d8b3958acb168d /tests/load/driver.cxx
parent6a2e318a38ec57c61a6c1b9a11cdf96dffe5a63e (diff)
Add support for build include/exclude manifest values
Diffstat (limited to 'tests/load/driver.cxx')
-rw-r--r--tests/load/driver.cxx32
1 files changed, 24 insertions, 8 deletions
diff --git a/tests/load/driver.cxx b/tests/load/driver.cxx
index a907be1..2c8f4b6 100644
--- a/tests/load/driver.cxx
+++ b/tests/load/driver.cxx
@@ -46,6 +46,16 @@ check_external (const package& p)
p.requirements.empty () && !p.sha256sum;
}
+namespace bpkg
+{
+ static bool
+ operator== (const build_constraint& x, const build_constraint& y)
+ {
+ return x.exclusion == y.exclusion && x.config == y.config &&
+ x.target == y.target && x.comment == y.comment;
+ }
+}
+
int
main (int argc, char* argv[])
{
@@ -237,13 +247,11 @@ main (int argc, char* argv[])
assert (fpv2->dependencies[0].size () == 1);
assert (fpv2->dependencies[1].size () == 1);
- auto dep (
- [&db](const char* n,
- const optional<dependency_constraint>& c) -> dependency
- {
- return {
- lazy_shared_ptr<package> (db, package_id (n, version ())), c};
- });
+ auto dep = [&db] (
+ const char* n, const optional<dependency_constraint>& c) -> dependency
+ {
+ return {lazy_shared_ptr<package> (db, package_id (n, version ())), c};
+ };
assert (fpv2->dependencies[0][0] ==
dep (
@@ -635,9 +643,17 @@ main (int argc, char* argv[])
assert (epv->requirements.empty ());
+ db.load (*epv, epv->build_section);
+
+ assert (
+ epv->build_constraints ==
+ build_constraints ({
+ build_constraint (false, "linux*", nullopt, ""),
+ build_constraint (true, "*", nullopt, "Only supported on Linux.")}));
+
assert (check_location (epv));
assert (epv->sha256sum && *epv->sha256sum ==
- "96add9edada45f4ceee18b3ec344ca3c4fc1473d9aad22a13e97d7728a439087");
+ "0a7414d06ad26d49dad203deaf3841f3df97f1fe27c5bf190c1c20dfeb7f84e0");
// Verify libpq package version.
//