From 2d907a525ab169f1cb97b87550e3646fde003733 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 3 Sep 2019 00:18:20 +0300 Subject: Adapt to optional package revision --- tests/load/1/math/libfoo-1.2.4+1.tar.gz | Bin 990 -> 993 bytes tests/load/1/math/packages.manifest | 4 ++-- tests/load/driver.cxx | 38 ++++++++++++++++++-------------- 3 files changed, 24 insertions(+), 18 deletions(-) (limited to 'tests/load') diff --git a/tests/load/1/math/libfoo-1.2.4+1.tar.gz b/tests/load/1/math/libfoo-1.2.4+1.tar.gz index 94deae1..5d19fa6 100644 Binary files a/tests/load/1/math/libfoo-1.2.4+1.tar.gz and b/tests/load/1/math/libfoo-1.2.4+1.tar.gz differ diff --git a/tests/load/1/math/packages.manifest b/tests/load/1/math/packages.manifest index 74984e9..429e61f 100644 --- a/tests/load/1/math/packages.manifest +++ b/tests/load/1/math/packages.manifest @@ -72,7 +72,7 @@ src-url: http://scm.example.com/?p=odb/libodb.git\;a=tree; Source tree url. package-url: http://www.example.com/foo/pack; Package details. email: foo-users@example.com; Public mailing list. Read FAQ before posting. package-email: pack@example.com; Current packager. -depends: libmisc < 1.1 | libmisc > 2.3.0; Crashes with 1.1.0-2.3.0. +depends: libmisc < 1.1 | libmisc > 2.3.0+0; Crashes with 1.1.0-2.3.0. depends: libexp >= 1.0 depends: ? libstudxml | libexpat; The newer the better. requires: linux | windows | macosx; Symbian support is coming. @@ -80,7 +80,7 @@ requires: c++11 requires: ? ; libc++ standard library if using Clang on Mac OS X. requires: ? vc++ >= 12.0; Only if using VC++ on Windows. location: libfoo-1.2.4+1.tar.gz -sha256sum: 0a206d2b5e575549914ed43b87470b33512e975fffa4fc8f3eb92b3dea66979e +sha256sum: 533108c89724a80ba739168ec92540dff0b7d3660fa0771de780d8595ccff425 : name: libpq version: 0 diff --git a/tests/load/driver.cxx b/tests/load/driver.cxx index 1afa411..6877f4b 100644 --- a/tests/load/driver.cxx +++ b/tests/load/driver.cxx @@ -208,6 +208,12 @@ dep (const char* n, optional c) return dependency {package_name (n), move (c), nullptr}; } +static inline version +dep_ver (const char* v) +{ + return version (v, false /* fold_zero_revision */); +} + static void test_git_repos (const cstrings& loader_args, const dir_path& loadtab_dir, @@ -265,7 +271,7 @@ test_git_repos (const cstrings& loader_args, assert (p->dependencies[0][0] == dep ("libmisc", dependency_constraint ( - version ("1.0"), false, version ("1.0"), false))); + dep_ver ("1.0"), false, dep_ver ("1.0"), false))); assert (p->buildable); @@ -461,12 +467,12 @@ test_pkg_repos (const cstrings& loader_args, assert (fpv2->dependencies[0][0] == dep ("libbar", dependency_constraint ( - nullopt, true, version ("2.4.0"), false))); + nullopt, true, dep_ver ("2.4.0"), false))); assert (fpv2->dependencies[1][0] == dep ("libexp", dependency_constraint ( - version ("+2-1.2"), false, version ("+2-1.2"), false))); + dep_ver ("+2-1.2"), false, dep_ver ("+2-1.2"), false))); assert (check_location (fpv2)); @@ -508,27 +514,27 @@ test_pkg_repos (const cstrings& loader_args, assert (fpv2a->dependencies[0][0] == dep ("libmisc", dependency_constraint ( - version ("0.1"), false, version ("2.0.0-"), true))); + dep_ver ("0.1"), false, dep_ver ("2.0.0-"), true))); assert (fpv2a->dependencies[0][1] == dep ("libmisc", dependency_constraint ( - version ("2.0"), false, version ("5.0"), false))); + dep_ver ("2.0"), false, dep_ver ("5.0"), false))); assert (fpv2a->dependencies[1][0] == dep ("libgenx", dependency_constraint ( - version ("0.2"), true, version ("3.0"), true))); + dep_ver ("0.2"), true, dep_ver ("3.0"), true))); assert (fpv2a->dependencies[2][0] == dep ("libexpat", dependency_constraint ( - nullopt, true, version ("5.2"), true))); + nullopt, true, dep_ver ("5.2"), true))); assert (fpv2a->dependencies[2][1] == dep ("libexpat", dependency_constraint ( - version ("1"), true, version ("5.1"), false))); + dep_ver ("1"), true, dep_ver ("5.1"), false))); assert (fpv2a->requirements.empty ()); @@ -568,7 +574,7 @@ test_pkg_repos (const cstrings& loader_args, assert (fpv3->dependencies[0][0] == dep ("libmisc", dependency_constraint ( - version ("2.0.0"), false, nullopt, true))); + dep_ver ("2.0.0"), false, nullopt, true))); assert (check_location (fpv3)); @@ -607,7 +613,7 @@ test_pkg_repos (const cstrings& loader_args, assert (fpv4->dependencies[0][0] == dep ("libmisc", dependency_constraint ( - version ("2.0.0"), false, nullopt, true))); + dep_ver ("2.0.0"), false, nullopt, true))); assert (check_location (fpv4)); @@ -691,7 +697,7 @@ test_pkg_repos (const cstrings& loader_args, assert (xpv->dependencies[0][0] == dep ("libexpat", dependency_constraint ( - version ("2.0.0"), false, nullopt, true))); + dep_ver ("2.0.0"), false, nullopt, true))); assert (xpv->dependencies[1].size () == 1); assert (xpv->dependencies[1][0] == dep ("libgenx", nullopt)); @@ -776,12 +782,12 @@ test_pkg_repos (const cstrings& loader_args, assert (fpv5->dependencies[0][0] == dep ("libmisc", dependency_constraint ( - nullopt, true, version ("1.1"), true))); + nullopt, true, dep_ver ("1.1"), true))); assert (fpv5->dependencies[0][1] == dep ("libmisc", dependency_constraint ( - version ("2.3.0"), true, nullopt, true))); + dep_ver ("2.3.0+0"), true, nullopt, true))); assert (fpv5->dependencies[1].size () == 1); assert (fpv5->dependencies[1].comment.empty ()); @@ -789,7 +795,7 @@ test_pkg_repos (const cstrings& loader_args, assert (fpv5->dependencies[1][0] == dep ("libexp", dependency_constraint ( - version ("1.0"), false, nullopt, true))); + dep_ver ("1.0"), false, nullopt, true))); assert (fpv5->dependencies[2].size () == 2); assert (fpv5->dependencies[2].comment == "The newer the better."); @@ -820,7 +826,7 @@ test_pkg_repos (const cstrings& loader_args, assert (check_location (fpv5)); assert (fpv5->sha256sum && *fpv5->sha256sum == - "0a206d2b5e575549914ed43b87470b33512e975fffa4fc8f3eb92b3dea66979e"); + "533108c89724a80ba739168ec92540dff0b7d3660fa0771de780d8595ccff425"); assert (fpv5->buildable); @@ -861,7 +867,7 @@ test_pkg_repos (const cstrings& loader_args, assert (epv->dependencies[1][0] == dep ("libpq", dependency_constraint ( - version ("9.0.0"), false, nullopt, true))); + dep_ver ("9.0.0"), false, nullopt, true))); assert (epv->requirements.empty ()); -- cgit v1.1