aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-05-30 23:55:33 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-05-31 18:32:27 +0300
commit0f211c23677faffc005c5ead5ea5a509cc8390aa (patch)
tree3cafa9840b4512d8fec3234527a351468cf1cb8d /tests
parentab9f63449f38a2ee7fe98d2644b303beaa499773 (diff)
Allow specifying system package that doesn't belong to any repository for pkg-build
Diffstat (limited to 'tests')
-rw-r--r--tests/pkg-build.testscript57
-rw-r--r--tests/pkg-system.testscript31
2 files changed, 85 insertions, 3 deletions
diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript
index fdedc0c..7ef78ff 100644
--- a/tests/pkg-build.testscript
+++ b/tests/pkg-build.testscript
@@ -1302,6 +1302,58 @@ test.options += --no-progress
$* '?libbar/1.3' 2>'error: unknown package libbar/1.3' != 0
}
+ : system-no-repo
+ :
+ {
+ $clone_root_cfg;
+
+ cp -r $src/libfoo-1.1.0 libfoo;
+ echo 'depends: libhello >= 1.0' >+libfoo/manifest;
+ $rep_add libfoo --type dir;
+
+ $rep_fetch;
+
+ $* libfoo 2>>~%EOE% != 0;
+ error: unknown dependency libhello >= 1.0 of package libfoo
+ %.+
+ EOE
+
+ $* libfoo '?sys:libhello' 2>'error: unknown package sys:libhello' != 0;
+
+ $* "?sys:libhello/2.0@$rep/t0a" --trust-yes 2>>~%EOE% != 0;
+ %.+
+ %error: package sys:libhello/2\.0 is not found in .+t0a%
+ EOE
+
+ $* libfoo '?sys:libhello/0.1' 2>>~%EOE% != 0;
+ error: unable to satisfy constraints on package libhello
+ %.+
+ EOE
+
+ $* libfoo '?sys:libhello/*' 2>>~%EOE%;
+ configured sys:libhello/*
+ using libfoo/1.1.0 (external)
+ configured libfoo/1.1.0
+ %info: .+ is up to date%
+ updated libfoo/1.1.0
+ EOE
+
+ $pkg_status libhello >'libhello configured,system !*';
+
+ $* '?sys:libhello/2.0' --yes 2>>~%EOE%;
+ disfigured libfoo/1.1.0
+ purged libhello/*
+ configured sys:libhello/2.0
+ configured libfoo/1.1.0
+ %info: .+ is up to date%
+ updated libfoo/1.1.0
+ EOE
+
+ $pkg_status libhello >'libhello configured,system !2.0';
+
+ $pkg_drop libfoo
+ }
+
: unused
:
{
@@ -1317,7 +1369,10 @@ test.options += --no-progress
{
$clone_cfg;
- $* --yes libbar/1.0.0 2>>EOE;
+ # Here we also test that specifying unknown but unused system
+ # dependencies.
+ #
+ $* --yes libbar/1.0.0 '?sys:libbox/*' '?sys:libbux/1' 2>>EOE;
fetched libfoo/1.0.0
unpacked libfoo/1.0.0
configured libfoo/1.0.0
diff --git a/tests/pkg-system.testscript b/tests/pkg-system.testscript
index 7033b9e..3e2cf01 100644
--- a/tests/pkg-system.testscript
+++ b/tests/pkg-system.testscript
@@ -48,6 +48,31 @@ rep_add += -d cfg 2>!
rep_fetch += -d cfg --auth all --trust-yes 2>!
rep_remove += -d cfg 2>!
+: no-repo
+:
+{
+ $clone_cfg;
+
+ $pkg_build 'sys:libbar' 2>>EOE != 0;
+ error: unknown package libbar
+ info: configuration cfg/ has no repositories
+ info: use 'bpkg rep-add' to add a repository
+ EOE
+
+ $pkg_build 'sys:libbar/1' 2>>EOE;
+ configured sys:libbar/1
+ EOE
+
+ $pkg_status libbar >'!libbar configured,system !1';
+
+ $pkg_build 'sys:libbar/*' 2>>EOE;
+ purged libbar/1
+ configured sys:libbar/*
+ EOE
+
+ $pkg_status libbar >'!libbar configured,system !*'
+}
+
# Note that when we fetch a package from remote repository the bpkg stderr
# contains fetch program progress output, that comes prior the informational
# message.
@@ -826,12 +851,14 @@ rep_remove += -d cfg 2>!
info: while satisfying foo/2
EOE
- $pkg_build 'sys:libbar/1' 2>>EOE != 0;
+ $pkg_build 'sys:libbar' 2>>EOE != 0;
error: unknown package libbar
EOE
$pkg_build foo 'sys:libbar/1' 2>>EOE != 0;
- error: unknown package libbar
+ error: dependency libbar >= 2 of package foo is not available in source
+ info: sys:libbar/1 does not satisfy the constrains
+ info: while satisfying foo/2
EOE
$pkg_build foo '?sys:libbar/1' 2>>EOE != 0;