aboutsummaryrefslogtreecommitdiff
path: root/tests/load/driver.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-08-30 00:00:35 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-08-30 00:56:59 +0300
commit321fa79e78c17bdb1e3e27f6e8b9d019201584a1 (patch)
treef6078ad550bebb3aea764234a64639fd3277bd1c /tests/load/driver.cxx
parent38bb6be4c90c7fbf95b8e5345de21175d3f1ebd7 (diff)
Support stubs in loader
Diffstat (limited to 'tests/load/driver.cxx')
-rw-r--r--tests/load/driver.cxx31
1 files changed, 23 insertions, 8 deletions
diff --git a/tests/load/driver.cxx b/tests/load/driver.cxx
index 5f55701..597625f 100644
--- a/tests/load/driver.cxx
+++ b/tests/load/driver.cxx
@@ -71,15 +71,15 @@ main (int argc, char* argv[])
for (; i < argc - 1; ++i)
{
string n (argv[i]);
- if (n == "--db-user")
+ if (n == "--db-user" || n == "-u")
user = argv[++i];
else if (n == "--db-password")
password = argv[++i];
- else if (n == "--db-name")
+ else if (n == "--db-name" || n == "-n")
name = argv[++i];
- else if (n == "--db-host")
+ else if (n == "--db-host" || n == "-h")
host = argv[++i];
- else if (n == "--db-port")
+ else if (n == "--db-port" || n == "-p")
port = stoul (argv[++i]);
}
@@ -128,7 +128,7 @@ main (int argc, char* argv[])
transaction t (db.begin ());
assert (db.query<repository> ().size () == 7);
- assert (db.query<package> ().size () == 16);
+ assert (db.query<package> ().size () == 17);
shared_ptr<repository> sr (
db.load<repository> ("dev.cppget.org/stable"));
@@ -621,16 +621,31 @@ main (int argc, char* argv[])
assert (epv->license_alternatives[0].size () == 1);
assert (epv->license_alternatives[0][0] == "MIT");
- assert (epv->dependencies.size () == 1);
+ assert (epv->dependencies.size () == 2);
assert (epv->dependencies[0].size () == 1);
assert (epv->dependencies[0][0] == dep ("libmisc", nullopt));
+ assert (epv->dependencies[1].size () == 1);
+ assert (epv->dependencies[1][0] ==
+ dep ("libpq",
+ optional<dependency_constraint> (
+ dependency_constraint (
+ version ("9.0.0"), false, nullopt, true))));
+
assert (epv->requirements.empty ());
assert (check_location (epv));
-
assert (epv->sha256sum && *epv->sha256sum ==
- "6c1869459964c8c780bd63d67e4c0727e583965e7280fd1f31be3f3639206191");
+ "49172533e10e1dd9b8f80bcd25d25397f143ba49a944cd8cb8fd273823b7c10e");
+
+ // Verify libpq package version.
+ //
+ // libpq-0
+ //
+ shared_ptr<package> qpv (
+ db.load<package> (package_id ("libpq", version ("0"))));
+
+ assert (qpv->summary == "PostgreSQL C API client library");
// Verify 'misc' repository.
//