aboutsummaryrefslogtreecommitdiff
path: root/tests/manifest
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-01-12 21:51:27 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-01-16 10:29:03 +0300
commit8cb3544c88bdbd4da9f1f4962ad2fe9ff741ef2e (patch)
tree3bdfd85b2f2ee699a05bca0a6722f3e19b7c5aca /tests/manifest
parent3251fe0b1793ee0b1897ec595f9a9e8f9f484a7b (diff)
Add *-name, *-version, and *-to-downstream-version package manifest values
Diffstat (limited to 'tests/manifest')
-rw-r--r--tests/manifest/driver.cxx8
-rw-r--r--tests/manifest/testscript97
2 files changed, 101 insertions, 4 deletions
diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx
index c0d8693..fb40f7e 100644
--- a/tests/manifest/driver.cxx
+++ b/tests/manifest/driver.cxx
@@ -40,7 +40,7 @@ using namespace bpkg;
// In the second form read and parse the package manifest from stdin and
// serialize it to stdout.
//
-// -c complete the dependency constraints
+// -c complete the incomplete values (depends, <distribution>-version, etc)
// -i ignore unknown
//
// Note: the above options should go after -p on the command line.
@@ -74,7 +74,7 @@ main (int argc, char* argv[])
{
if (mode == "-p")
{
- bool complete_dependencies (false);
+ bool complete_values (false);
bool ignore_unknown (false);
bool long_lines (false);
@@ -83,7 +83,7 @@ main (int argc, char* argv[])
string o (argv[i]);
if (o == "-c")
- complete_dependencies = true;
+ complete_values = true;
else if (o == "-i")
ignore_unknown = true;
else if (o == "-l")
@@ -114,7 +114,7 @@ main (int argc, char* argv[])
}
},
ignore_unknown,
- complete_dependencies).serialize (s);
+ complete_values).serialize (s);
}
else if (mode == "-ec")
{
diff --git a/tests/manifest/testscript b/tests/manifest/testscript
index 336b288..c696be7 100644
--- a/tests/manifest/testscript
+++ b/tests/manifest/testscript
@@ -606,6 +606,103 @@
}
}
+ : distribution
+ :
+ {
+ : incomplete
+ :
+ {
+ $* <<EOF >>EOF
+ : 1
+ name: libcrypto
+ version: 1.1.1+18
+ upstream-version: 1.1.1n
+ summary: C library providing general cryptography and X.509 support
+ license: OpenSSL
+ debian-name: libssl1.1 libssl-dev
+ debian-version: 1.1.1n
+ debian-to-downstream-version: /([^.])\.([^.])\.([^.])n/\1.\2.\3+18/
+ debian-to-downstream-version: /([^.])\.([^.])\.([^.])o/\1.\2.\3+19/
+ debian-to-downstream-version: /([^.])\.([^.])\.([^.])p/\1.\2.\3+20/
+ fedora-name: openssl-libs openssl-devel
+ fedora-version: $
+ EOF
+ }
+
+ : complete
+ :
+ {
+ $* -c <<EOI >>EOO
+ : 1
+ name: libcrypto
+ version: +2-1.1.1-a.1+2
+ upstream-version: 1.1.1n
+ summary: C library providing general cryptography and X.509 support
+ license: OpenSSL
+ fedora-name: openssl-libs openssl-devel
+ fedora-version: $
+ EOI
+ : 1
+ name: libcrypto
+ version: +2-1.1.1-a.1+2
+ upstream-version: 1.1.1n
+ summary: C library providing general cryptography and X.509 support
+ license: OpenSSL
+ fedora-name: openssl-libs openssl-devel
+ fedora-version: 1.1.1
+ EOO
+ }
+
+ : dash-in-name
+ :
+ {
+ $* <<EOI 2>>EOE != 0
+ : 1
+ name: libcrypto
+ version: 1.1.1+18
+ upstream-version: 1.1.1n
+ summary: C library providing general cryptography and X.509 support
+ license: OpenSSL
+ de-bian-name: libssl1.1 libssl-dev
+ EOI
+ stdin:7:1: error: distribution name 'de-bian' contains '-'
+ EOE
+ }
+
+ : empty-value
+ :
+ {
+ $* <<EOI 2>>EOE != 0
+ : 1
+ name: libcrypto
+ version: 1.1.1+18
+ upstream-version: 1.1.1n
+ summary: C library providing general cryptography and X.509 support
+ license: OpenSSL
+ debian-name:
+ EOI
+ stdin:7:13: error: empty package distribution value
+ EOE
+ }
+
+ : redefinition
+ :
+ {
+ $* <<EOI 2>>EOE != 0
+ : 1
+ name: libcrypto
+ version: 1.1.1+18
+ upstream-version: 1.1.1n
+ summary: C library providing general cryptography and X.509 support
+ license: OpenSSL
+ debian-name: libssl1.1 libssl-dev
+ debian-name: libssl1.1 libssl-dev
+ EOI
+ stdin:8:1: error: package distribution value redefinition
+ EOE
+ }
+ }
+
: depends
:
{