aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-10 14:19:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-11 13:25:52 +0200
commitaae6d7557950c19d22b7d09fae26f3d20db75a22 (patch)
tree3ef10cd2b05eef0b2f2d387a1838cd6aa835ad68 /tests
parenta90ce0f4ff27c6994fe3e7827baaebf4e510cffb (diff)
Location member added to brep::package_version class
Diffstat (limited to 'tests')
-rw-r--r--tests/loader/driver.cxx18
-rw-r--r--tests/loader/external/1/misc/packages1
-rw-r--r--tests/loader/internal/1/math/packages2
-rw-r--r--tests/loader/internal/1/stable/packages4
4 files changed, 25 insertions, 0 deletions
diff --git a/tests/loader/driver.cxx b/tests/loader/driver.cxx
index 0c6c995..e828e79 100644
--- a/tests/loader/driver.cxx
+++ b/tests/loader/driver.cxx
@@ -35,6 +35,17 @@ operator== (const dependency& a, const dependency& b)
a.version->operation == b.version->operation));
}
+static bool
+check_location (shared_ptr<package_version>& pv)
+{
+ if (pv->repository.load ()->internal)
+ return pv->location && *pv->location ==
+ path (pv->package.load ()->name + "-" + pv->version.string () +
+ ".tar.gz");
+ else
+ return !pv->location;
+}
+
int
main (int argc, char* argv[])
{
@@ -143,6 +154,7 @@ main (int argc, char* argv[])
fv1.epoch (),
fv1.canonical_upstream ()}));
assert (srv[0].load () == fpv1);
+ assert (check_location (fpv1));
version fv2 ("1.2.3-4");
shared_ptr<package_version> fpv2 (
@@ -153,6 +165,7 @@ main (int argc, char* argv[])
fv2.epoch (),
fv2.canonical_upstream ()}));
assert (srv[1].load () == fpv2);
+ assert (check_location (fpv2));
version fv3 ("1.2.4");
shared_ptr<package_version> fpv3 (
@@ -163,6 +176,7 @@ main (int argc, char* argv[])
fv3.epoch (),
fv3.canonical_upstream ()}));
assert (srv[2].load () == fpv3);
+ assert (check_location (fpv3));
version xv ("1.0.0-1");
shared_ptr<package_version> xpv (
@@ -173,6 +187,7 @@ main (int argc, char* argv[])
xv.epoch (),
xv.canonical_upstream ()}));
assert (srv[3].load () == xpv);
+ assert (check_location (xpv));
// Verify libstudxml package.
//
@@ -358,6 +373,7 @@ main (int argc, char* argv[])
ev.epoch (),
ev.canonical_upstream ()}));
assert (mrv[0].load () == epv);
+ assert (check_location (epv));
version fv4 ("1.2.4-1");
shared_ptr<package_version> fpv4 (
@@ -369,6 +385,7 @@ main (int argc, char* argv[])
fv4.canonical_upstream ()}));
assert (mrv[1].load () == fpv4);
assert (fpv[3].load () == fpv4);
+ assert (check_location (fpv4));
// Verify libexp package.
//
@@ -433,6 +450,7 @@ main (int argc, char* argv[])
bv.epoch (),
bv.canonical_upstream ()}));
assert (crv[0].load () == bpv);
+ assert (check_location (bpv));
// Verify libbar package.
//
diff --git a/tests/loader/external/1/misc/packages b/tests/loader/external/1/misc/packages
index de96771..718b30e 100644
--- a/tests/loader/external/1/misc/packages
+++ b/tests/loader/external/1/misc/packages
@@ -12,3 +12,4 @@ depends: libfoo
depends: libmath >= 2.0.0
requires: linux | windows | macosx
changes: some changes
+location: libbar-2.3.5.tar.gz
diff --git a/tests/loader/internal/1/math/packages b/tests/loader/internal/1/math/packages
index e55168f..f2d7024 100644
--- a/tests/loader/internal/1/math/packages
+++ b/tests/loader/internal/1/math/packages
@@ -7,6 +7,7 @@ tags: c++, exponent
url: http://www.exp.com
email: users@exp.com
depends: libmisc
+location: libexp-1+1.2.tar.gz
:
name: libfoo
version: 1.2.4-1
@@ -17,3 +18,4 @@ tags: c++, foo, math
url: http://www.example.com/foo/
email: foo-users@example.com
depends: libmisc >= 2.3.0
+location: libfoo-1.2.4-1.tar.gz
diff --git a/tests/loader/internal/1/stable/packages b/tests/loader/internal/1/stable/packages
index 59898c1..b95aa62 100644
--- a/tests/loader/internal/1/stable/packages
+++ b/tests/loader/internal/1/stable/packages
@@ -7,6 +7,7 @@ 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
:
name: libstudxml
version: 1.0.0-1
@@ -21,6 +22,7 @@ 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
:
name: libfoo
version: 1.2.2
@@ -35,6 +37,7 @@ requires: linux | windows | macosx
requires: c++11
requires: ? ; VC++ 12.0 or later if targeting Windows.
requires: ? ; libc++ standard library if using Clang on Mac OS X.
+location: libfoo-1.2.2.tar.gz
:
name: libfoo
version: 1.2.4
@@ -47,3 +50,4 @@ email: foo-users@example.com
depends: libmisc >= 2.0.0
changes: some changes 1
changes: some changes 2
+location: libfoo-1.2.4.tar.gz