aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-08-29 14:35:51 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2018-08-29 17:49:09 +0300
commit9caa44624c688ebba6bc041c273102150b1a59e7 (patch)
treec6f592f28258321ffa6c5debe2080f89891790a4 /tests
parent5e9beb9b7020ed688a1df23344df809af3618b8b (diff)
Add --{repositories|packages}-file options to bpkg-rep-info
This allows saving both manifests with a single invocation (which is the only way to guarantee they are consistent).
Diffstat (limited to 'tests')
-rw-r--r--tests/rep-info.test72
1 files changed, 68 insertions, 4 deletions
diff --git a/tests/rep-info.test b/tests/rep-info.test
index 60dd96e..d7a80a9 100644
--- a/tests/rep-info.test
+++ b/tests/rep-info.test
@@ -81,16 +81,18 @@ $* --name $rep/testing >"pkg:build2.org/rep-info/testing ($rep/testing)"
: packages
:
{
+ test.arguments += --packages # Should go after the rep-info command argument.
+
: list
:
- $* --packages $rep/testing >>EOO
+ $* $rep/testing >>EOO
foo/1
EOO
: manifest
:
- $* --packages --manifest $rep/testing >>EOO
+ $* --manifest $rep/testing >>EOO
: 1
name: foo
version: 1
@@ -101,21 +103,54 @@ $* --name $rep/testing >"pkg:build2.org/rep-info/testing ($rep/testing)"
location: foo-1.tar.gz
sha256sum: fee330a362a4f87ff42a954aa305b6446d541b7b60000ebcd2fbf68f2b1ae58e
EOO
+
+ : to-file
+ :
+ {
+ : no-manifest
+ :
+ $* --packages-file m $rep/testing 2>>EOE != 0
+ error: --packages-file specified without --manifest
+ info: run 'bpkg help rep-info' for more information
+ EOE
+
+ : manifest
+ :
+ {
+ $* --manifest --packages-file m $rep/testing &m;
+
+ cat m >>EOO
+ : 1
+ name: foo
+ version: 1
+ summary: The "Foo" utility
+ license: MIT
+ url: http://www.example.org/foo
+ email: foo-users@example.org
+ location: foo-1.tar.gz
+ sha256sum: fee330a362a4f87ff42a954aa305b6446d541b7b60000ebcd2fbf68f2b1ae58e
+ EOO
+ }
+ }
}
: repositories
:
{
+ # Should go after the rep-info command argument.
+ #
+ test.arguments += --repositories
+
: list
:
- $* --repositories $rep/testing >>"EOO"
+ $* $rep/testing >>"EOO"
prerequisite pkg:build2.org/foo/testing ($rep_root/foo/testing)
complement pkg:build2.org/rep-info/stable ($rep/stable)
EOO
: manifest
:
- $* --repositories --manifest $rep/testing >>EOO
+ $* --manifest $rep/testing >>EOO
: 1
location: ../../foo/testing
type: pkg
@@ -126,6 +161,35 @@ $* --name $rep/testing >"pkg:build2.org/rep-info/testing ($rep/testing)"
role: complement
:
EOO
+
+ : to-file
+ :
+ {
+ : no-manifest
+ :
+ $* --repositories-file m $rep/testing 2>>EOE != 0
+ error: --repositories-file specified without --manifest
+ info: run 'bpkg help rep-info' for more information
+ EOE
+
+ : manifest
+ :
+ {
+ $* --manifest --repositories-file m $rep/testing &m;
+
+ cat m >>EOO
+ : 1
+ location: ../../foo/testing
+ type: pkg
+ role: prerequisite
+ :
+ location: ../stable
+ type: pkg
+ role: complement
+ :
+ EOO
+ }
+ }
}
: cert