From dd0f7ec5e776c25cbb0b6715bf62d52a9965f9b1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 25 Dec 2015 19:59:45 +0200 Subject: Support version release --- tests/loader/1/math/packages | 14 +++++++------- tests/loader/1/misc/packages | 8 ++++---- tests/loader/1/stable/packages | 15 ++++++++++++--- tests/loader/driver.cxx | 42 +++++++++++++++++++++++++++++++++--------- 4 files changed, 56 insertions(+), 23 deletions(-) (limited to 'tests') diff --git a/tests/loader/1/math/packages b/tests/loader/1/math/packages index 4d34c13..7b81c5e 100644 --- a/tests/loader/1/math/packages +++ b/tests/loader/1/math/packages @@ -1,6 +1,6 @@ : 1 name: libstudxml -version: 1.0.0-1 +version: 1.0.0+1 summary: Modern C++ XML API license: MIT tags: c++, xml, parser, serializer, pull, streaming, modern @@ -12,10 +12,10 @@ email: studxml-users@codesynthesis.com; Public mailing list, posts by\ package-email: boris@codesynthesis.com; Direct email to the author. depends: libexpat >= 2.0.0 depends: libgenx -location: libstudxml-1.0.0-1.tar.gz +location: libstudxml-1.0.0+1.tar.gz : name: libexp -version: 1+1.2 +version: 1~1.2 summary: The exponent description: The exponent math function. license: MIT @@ -23,10 +23,10 @@ tags: c++, exponent url: http://www.exp.com email: users@exp.com depends: libmisc -location: libexp-1+1.2.tar.gz +location: libexp-1~1.2.tar.gz : name: libfoo -version: 1.2.4-1 +version: 1.2.4+1 summary: The Foo Math Library description:\ A modern C++ library with easy to use linear algebra and lot of optimization @@ -52,9 +52,9 @@ requires: linux | windows | macosx; Symbian support is coming. 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 +location: libfoo-1.2.4+1.tar.gz changes:\ -1.2.4-1 +1.2.4+1 * applied patch for critical bug-219 * regenerated documentation diff --git a/tests/loader/1/misc/packages b/tests/loader/1/misc/packages index e47208d..fec3780 100644 --- a/tests/loader/1/misc/packages +++ b/tests/loader/1/misc/packages @@ -31,17 +31,17 @@ email: foo-users@example.com location: libfoo-0.1.tar.gz : name: libfoo -version: 1.2.4-1 +version: 1.2.4+1 summary: Foo Library license: MIT url: http://www.example.com/foo/ email: foo-users@example.com -location: libfoo-1.2.4-1.tar.gz +location: libfoo-1.2.4+1.tar.gz : name: libfoo -version: 1.2.4-2 +version: 1.2.4+2 summary: Foo Library license: MIT url: http://www.example.com/foo/ email: foo-users@example.com -location: libfoo-1.2.4-2.tar.gz +location: libfoo-1.2.4+2.tar.gz diff --git a/tests/loader/1/stable/packages b/tests/loader/1/stable/packages index 756a562..1a385c3 100644 --- a/tests/loader/1/stable/packages +++ b/tests/loader/1/stable/packages @@ -1,13 +1,13 @@ : 1 name: libfoo -version: 1.2.3-4 +version: 1.2.3+4 summary: The Foo library license: MIT tags: c++, foo url: http://www.example.com/foo/ email: foo-users@example.com depends: libmisc >= 2.0.0 -location: libfoo-1.2.3-4.tar.gz +location: libfoo-1.2.3+4.tar.gz : name: libfoo version: 1.2.2 @@ -17,10 +17,19 @@ tags: c++, foo url: http://www.example.com/foo/ email: foo-users@example.com depends: libbar <= 2.4.0 -depends: libexp == 1+1.2 +depends: libexp == 1~1.2 location: libfoo-1.2.2.tar.gz : name: libfoo +version: 1.2.2-alpha.1 +summary: The Foo library +license: MIT +tags: c++, foo +url: http://www.example.com/foo/ +email: foo-users@example.com +location: libfoo-1.2.2-alpha.1.tar.gz +: +name: libfoo version: 1.2.4 summary: The Foo Library description: Very good foo library. diff --git a/tests/loader/driver.cxx b/tests/loader/driver.cxx index 7ca1e6e..51f2ed8 100644 --- a/tests/loader/driver.cxx +++ b/tests/loader/driver.cxx @@ -99,7 +99,7 @@ main (int argc, char* argv[]) transaction t (db.begin ()); assert (db.query ().size () == 5); - assert (db.query ().size () == 14); + assert (db.query ().size () == 15); shared_ptr sr (db.load ("cppget.org/stable")); shared_ptr mr (db.load ("cppget.org/math")); @@ -138,8 +138,12 @@ main (int argc, char* argv[]) db.load (package_id ("libfoo", version ("1.2.2")))); assert (check_location (fpv2)); + shared_ptr fpv2a ( + db.load (package_id ("libfoo", version ("1.2.2-alpha.1")))); + assert (check_location (fpv2a)); + shared_ptr fpv3 ( - db.load (package_id ("libfoo", version ("1.2.3-4")))); + db.load (package_id ("libfoo", version ("1.2.3+4")))); assert (check_location (fpv3)); shared_ptr fpv4 ( @@ -218,9 +222,29 @@ main (int argc, char* argv[]) dep ( "libexp", optional ( - dependency_constraint{comparison::eq, version ("1+1.2")}))); + dependency_constraint{comparison::eq, version ("1~1.2")}))); - assert (fpv2->requirements.empty ()); + // libfoo-1.2.2-alpha.1 + // + assert (fpv2a->summary == "The Foo library"); + assert (fpv2a->tags == strings ({"c++", "foo"})); + assert (!fpv2a->description); + assert (fpv2a->url == "http://www.example.com/foo/"); + assert (!fpv2a->package_url); + assert (fpv2a->email == "foo-users@example.com"); + assert (!fpv2a->package_email); + + assert (fpv2a->internal_repository.load () == sr); + assert (fpv2a->other_repositories.empty ()); + assert (fpv2a->priority == priority::low); + assert (fpv2a->changes.empty ()); + + assert (fpv2a->license_alternatives.size () == 1); + assert (fpv2a->license_alternatives[0].size () == 1); + assert (fpv2a->license_alternatives[0][0] == "MIT"); + + assert (fpv2a->dependencies.empty ()); + assert (fpv2a->requirements.empty ()); // libfoo-1.2.3-4 // @@ -303,15 +327,15 @@ main (int argc, char* argv[]) assert (mr->internal); shared_ptr epv ( - db.load (package_id ("libexp", version ("1+1.2")))); + db.load (package_id ("libexp", version ("1~1.2")))); assert (check_location (epv)); shared_ptr fpv5 ( - db.load (package_id ("libfoo", version ("1.2.4-1")))); + db.load (package_id ("libfoo", version ("1.2.4+1")))); assert (check_location (fpv5)); shared_ptr xpv ( - db.load (package_id ("libstudxml", version ("1.0.0-1")))); + db.load (package_id ("libstudxml", version ("1.0.0+1")))); assert (check_location (xpv)); assert (mr->complements.empty ()); @@ -383,7 +407,7 @@ main (int argc, char* argv[]) assert (fpv5->priority.comment == "Critical bug fixes, performance improvement."); - const char ch[] = R"DLM(1.2.4-1 + const char ch[] = R"DLM(1.2.4+1 * applied patch for critical bug-219 * regenerated documentation @@ -512,7 +536,7 @@ main (int argc, char* argv[]) assert (check_location (fpv0)); shared_ptr fpv6 ( - db.load (package_id ("libfoo", version ("1.2.4-2")))); + db.load (package_id ("libfoo", version ("1.2.4+2")))); assert (check_location (fpv6)); assert (cr->prerequisites.empty ()); -- cgit v1.1