aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/loader/driver.cxx78
-rw-r--r--tests/loader/external/1/misc/packages8
-rw-r--r--tests/loader/internal/1/math/packages17
-rw-r--r--tests/loader/internal/1/stable/packages6
4 files changed, 77 insertions, 32 deletions
diff --git a/tests/loader/driver.cxx b/tests/loader/driver.cxx
index f8fb545..443da72 100644
--- a/tests/loader/driver.cxx
+++ b/tests/loader/driver.cxx
@@ -292,31 +292,14 @@ main (int argc, char* argv[])
brep::optional<version_comparison> (
version_comparison{version ("1+1.2"), comparison::eq})}));
- requirements& fpvr2 (fpv2->requirements);
- assert (fpvr2.size () == 4);
-
- assert (fpvr2[0] == strings ({"linux", "windows", "macosx"}));
- assert (!fpvr2[0].conditional);
- assert (fpvr2[0].comment.empty ());
-
- assert (fpvr2[1] == strings ({"c++11"}));
- assert (!fpvr2[1].conditional);
- assert (fpvr2[1].comment.empty ());
-
- assert (fpvr2[2].empty ());
- assert (fpvr2[2].conditional);
- assert (fpvr2[2].comment == "VC++ 12.0 or later if targeting Windows.");
-
- assert (fpvr2[3].empty ());
- assert (fpvr2[3].conditional);
- assert (fpvr2[3].comment ==
- "libc++ standard library if using Clang on Mac OS X.");
+ assert (fpv2->requirements.empty ());
assert (fpv3->internal_repository.load () == sr);
assert (fpv3->external_repositories.empty ());
assert (fpv3->package.load () == pf);
assert (fpv3->version == version ("1.2.3-4"));
assert (fpv3->priority == priority::low);
+
assert (fpv3->changes.empty ());
assert (fpv3->license_alternatives.size () == 1);
@@ -339,6 +322,8 @@ main (int argc, char* argv[])
assert (fpv4->changes == "some changes 1\nsome changes 2");
assert (fpv4->license_alternatives.size () == 1);
+ assert (fpv4->license_alternatives[0].comment ==
+ "Permissive free software license.");
assert (fpv4->license_alternatives[0].size () == 1);
assert (fpv4->license_alternatives[0][0] == "MIT");
@@ -390,11 +375,22 @@ main (int argc, char* argv[])
// Verify libfoo package versions.
//
assert (fpv5->internal_repository.load () == mr);
- assert (fpv5->external_repositories.empty ());
+ assert (fpv5->external_repositories.size () == 1);
+ assert (fpv5->external_repositories[0].load () == cr);
+
assert (fpv5->package.load () == pf);
assert (fpv5->version == version ("1.2.4-1"));
assert (fpv5->priority == priority::high);
- assert (fpv5->changes.empty ());
+ assert (fpv5->priority.comment == "Due to critical bug fix.");
+
+ const char ch[] = R"DLM(1.2.4-1
+ * applied patch for critical bug-219
+ * regenerated documentation
+
+1.2.4
+ * test suite extended significantly)DLM";
+
+ assert (fpv5->changes == ch);
assert (fpv5->license_alternatives.size () == 2);
assert (fpv5->license_alternatives[0].comment ==
@@ -407,16 +403,48 @@ main (int argc, char* argv[])
assert (fpv5->license_alternatives[1].size () == 1);
assert (fpv5->license_alternatives[1][0] == "BSD");
- assert (fpv5->dependencies.size () == 1);
- assert (fpv5->dependencies[0].size () == 1);
+ assert (fpv5->dependencies.size () == 2);
+ assert (fpv5->dependencies[0].size () == 2);
+ assert (fpv5->dependencies[0].comment ==
+ "Crashes in range [1.1, 2.3.0].");
assert (fpv5->dependencies[0][0] ==
(dependency {
"libmisc",
brep::optional<version_comparison> (
- version_comparison{version ("2.3.0"), comparison::ge})}));
+ version_comparison{version ("1.1"), comparison::lt})}));
- assert (fpv5->requirements.empty ());
+ assert (fpv5->dependencies[0][1] ==
+ (dependency {
+ "libmisc",
+ brep::optional<version_comparison> (
+ version_comparison{version ("2.3.0"), comparison::gt})}));
+
+ assert (fpv5->dependencies[1].size () == 1);
+ assert (fpv5->dependencies[1].comment == "Newer - better.");
+
+ assert (fpv5->dependencies[1][0] ==
+ (dependency {"libstudxml", nullopt}));
+
+ requirements& fpvr5 (fpv5->requirements);
+ assert (fpvr5.size () == 4);
+
+ assert (fpvr5[0] == strings ({"linux", "windows", "macosx"}));
+ assert (!fpvr5[0].conditional);
+ assert (fpvr5[0].comment == "Symbian is coming.");
+
+ assert (fpvr5[1] == strings ({"c++11"}));
+ assert (!fpvr5[1].conditional);
+ assert (fpvr5[1].comment.empty ());
+
+ assert (fpvr5[2] == strings ({"VC++"}));
+ assert (fpvr5[2].conditional);
+ assert (fpvr5[2].comment == "12.0 or later if targeting Windows.");
+
+ assert (fpvr5[3].empty ());
+ assert (fpvr5[3].conditional);
+ assert (fpvr5[3].comment ==
+ "libc++ standard library if using Clang on Mac OS X.");
// Verify libexp package.
//
diff --git a/tests/loader/external/1/misc/packages b/tests/loader/external/1/misc/packages
index 843408b..77e10de 100644
--- a/tests/loader/external/1/misc/packages
+++ b/tests/loader/external/1/misc/packages
@@ -29,3 +29,11 @@ license: MIT
url: http://www.example.com/foo/
email: foo-users@example.com
location: libfoo-0.1.tar.gz
+:
+name: libfoo
+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
diff --git a/tests/loader/internal/1/math/packages b/tests/loader/internal/1/math/packages
index 9ce4063..ac6c675 100644
--- a/tests/loader/internal/1/math/packages
+++ b/tests/loader/internal/1/math/packages
@@ -17,14 +17,27 @@ optimization tools. There are over 100 functions in total with an extensive \
test suite. The API is similar to MATLAB.
license: LGPLv2, MIT; If using with GNU TLS.
license: BSD; If using with OpenSSL.
-priority: high
+priority: high; Due to critical bug fix.
tags: c++, foo, math
url: http://www.example.com/foo/
email: foo-users@example.com
package-url: http://www.example.com/foo/pack
package-email: pack@example.com
-depends: libmisc >= 2.3.0
+depends: libmisc < 1.1 | libmisc > 2.3.0; Crashes in range [1.1, 2.3.0].
+depends: ? libstudxml; Newer - better.
+requires: linux | windows | macosx; Symbian is coming.
+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.4-1.tar.gz
+changes:\
+1.2.4-1
+ * applied patch for critical bug-219
+ * regenerated documentation
+
+1.2.4
+ * test suite extended significantly
+\
:
name: libfoo
version: 1.0
diff --git a/tests/loader/internal/1/stable/packages b/tests/loader/internal/1/stable/packages
index d5f1551..8d1e2fd 100644
--- a/tests/loader/internal/1/stable/packages
+++ b/tests/loader/internal/1/stable/packages
@@ -33,17 +33,13 @@ url: http://www.example.com/foo/
email: foo-users@example.com
depends: libbar <= 2.4.0
depends: libexp == 1+1.2
-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
summary: The Foo Library
description: Very good foo library.
-license: MIT
+license: MIT; Permissive free software license.
tags: c++, foo
url: http://www.example.com/foo/
email: foo-users@example.com