aboutsummaryrefslogtreecommitdiff
path: root/tests
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
parent6a2e318a38ec57c61a6c1b9a11cdf96dffe5a63e (diff)
Add support for build include/exclude manifest values
Diffstat (limited to 'tests')
-rw-r--r--tests/load/1/math/libexp-1~1.2+1.tar.gzbin315 -> 360 bytes
-rw-r--r--tests/load/1/math/packages4
-rw-r--r--tests/load/driver.cxx32
3 files changed, 27 insertions, 9 deletions
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
--- a/tests/load/1/math/libexp-1~1.2+1.tar.gz
+++ b/tests/load/1/math/libexp-1~1.2+1.tar.gz
Binary files 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<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.
//