From 4b9be1cb87c4759ca08aa89acd9e9fd7ba5b18be Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 6 Jul 2017 20:28:22 +0300 Subject: Add support for build include/exclude manifest values --- tests/load/1/math/libexp-1~1.2+1.tar.gz | Bin 315 -> 360 bytes tests/load/1/math/packages | 4 +++- tests/load/driver.cxx | 32 ++++++++++++++++++++++++-------- 3 files changed, 27 insertions(+), 9 deletions(-) (limited to 'tests/load') diff --git a/tests/load/1/math/libexp-1~1.2+1.tar.gz b/tests/load/1/math/libexp-1~1.2+1.tar.gz index 1e1807f..1d15a59 100644 Binary files a/tests/load/1/math/libexp-1~1.2+1.tar.gz and b/tests/load/1/math/libexp-1~1.2+1.tar.gz differ diff --git a/tests/load/1/math/packages b/tests/load/1/math/packages index 22a3167..a796d31 100644 --- a/tests/load/1/math/packages +++ b/tests/load/1/math/packages @@ -12,8 +12,10 @@ email: users@exp.com build-email: builds@exp.com depends: libmisc depends: libpq >= 9.0.0 +build-include: linux* +build-exclude: *; Only supported on Linux. location: libexp-1~1.2+1.tar.gz -sha256sum: 96add9edada45f4ceee18b3ec344ca3c4fc1473d9aad22a13e97d7728a439087 +sha256sum: 0a7414d06ad26d49dad203deaf3841f3df97f1fe27c5bf190c1c20dfeb7f84e0 : name: libfoo version: 1.0 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& c) -> dependency - { - return { - lazy_shared_ptr (db, package_id (n, version ())), c}; - }); + auto dep = [&db] ( + const char* n, const optional& c) -> dependency + { + return {lazy_shared_ptr (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. // -- cgit v1.1