aboutsummaryrefslogtreecommitdiff
path: root/tests/pkg-checkout.testscript
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pkg-checkout.testscript')
-rw-r--r--tests/pkg-checkout.testscript95
1 files changed, 72 insertions, 23 deletions
diff --git a/tests/pkg-checkout.testscript b/tests/pkg-checkout.testscript
index 398080e..85fe5e3 100644
--- a/tests/pkg-checkout.testscript
+++ b/tests/pkg-checkout.testscript
@@ -19,7 +19,6 @@ posix = ($cxx.target.class != 'windows')
#
$git_extract $src/git/libbar.tar
$git_extract $src/git/style-basic0.tar &$out_git/state0/***
- $git_extract $src/git/style-basic1.tar &$out_git/state1/***
if $posix
$git_extract $src/git/style.tar
@@ -54,12 +53,14 @@ else
$rep_add "$rep/libbar.git#master";
$rep_fetch;
- $* libmbar/1.0.0 2>>~%EOE% != 0
+ $* libmbar/1.0.0 2>>~%EOE%;
+ checking out libmbar/1.0.0
%.+
- error: no configured package satisfies dependency on style-basic >= 1.0.0
- warning: repository state is now broken
- info: run 'bpkg rep-fetch' to repair
+ distributing libmbar/1.0.0
+ checked out libmbar/1.0.0
EOE
+
+ $pkg_purge libmbar
}
: configured-dependency
@@ -71,7 +72,9 @@ else
$pkg_status style-basic | sed -n -e 's/style-basic available \[.+\] ([^ ]+)/\1/p' | set v;
- $* "style-basic/$v" 2>>"EOE";
+ $* "style-basic/$v" 2>>~"%EOE%";
+ verifying symlinks...
+ %fixing up symlinks...%?
distributing style-basic/$v
checked out style-basic/$v
EOE
@@ -94,15 +97,8 @@ else
: replacement
:
{
- # @@ Reduce to a single repository when multiple revisions can be specified
- # in the repository URL fragment.
- #
- rep0 = "$rep_git/state0";
- rep1 = "$rep_git/state1";
-
$clone_root_cfg;
- $rep_add "$rep0/style-basic.git#master";
- $rep_add "$rep1/style-basic.git#stable";
+ $rep_add "$rep/style-basic.git#master,stable";
$rep_fetch;
$pkg_status style-basic | \
@@ -157,6 +153,8 @@ else
$* links/0.0.1 2>>~%EOE%;
checking out links/0.0.1
+ verifying symlinks...
+ %fixing up symlinks...%?
distributing links/0.0.1
checked out links/0.0.1
EOE
@@ -176,17 +174,25 @@ else
#
$rep_fetch "$rep/links.git#v1.0.1";
+ # Note that on POSIX the repository is restored in its permanent location,
+ # since the operation fails in the distribution phase. This is in contrast
+ # to Windows where the repository is lost, since the operation fails in
+ # the fix-up phase.
+ #
if $posix
- $* links/1.0.1 2>>~%EOE%
+ $* links/1.0.1 2>>~%EOE% != 0
checking out links/1.0.1
+ verifying symlinks...
+ %fixing up symlinks...%?
distributing links/1.0.1
- checked out links/1.0.1
+ %warning: skipping dangling symlink .+%
+ %error: unable to stat .+%
EOE
-
- $pkg_purge links
else
$* links/1.0.1 2>>~%EOE% != 0
checking out links/1.0.1
+ verifying symlinks...
+ %fixing up symlinks...%?
error: target 'bl' for symlink 'lc' does not exist
info: re-run with -v for more information
warning: repository state is now broken
@@ -196,16 +202,14 @@ else
# Cyclic symlinks in the repository.
#
+ $rep_fetch "$rep/links.git#v1.0.2";
+
if $posix
- $rep_fetch "$rep/links.git#v1.0.2" 2>>~%EOE% != 0
+ $* links/1.0.2 2>>~%EOE% != 0
%.*
%error: unable to iterate over .+%
- warning: repository state is now broken and will be cleaned up
- info: run 'bpkg rep-fetch' to update
EOE
else
- $rep_fetch "$rep/links.git#v1.0.2"
-
$* links/1.0.2 2>>~%EOE% != 0
checking out links/1.0.2
%.*
@@ -216,4 +220,49 @@ else
EOE
end
}
+
+ : output-root
+ :
+ {
+ : no-purge
+ :
+ {
+ $clone_root_cfg;
+ $rep_add "$rep/libbar.git#master";
+ $rep_fetch;
+
+ $* --output-root $~ libmbar/1.0.0 &libmbar-1.0.0/*** 2>>~%EOE%;
+ checking out libmbar/1.0.0
+ %.+
+ distributing libmbar/1.0.0
+ checked out libmbar/1.0.0
+ EOE
+
+ test -f libmbar-1.0.0/manifest;
+
+ # While at it, test that the package is buildable.
+ #
+ $pkg_build libmbar -d cfg/ --yes 2>!;
+ $pkg_drop libmbar -d cfg/ --yes 2>!
+ }
+
+ : purge
+ :
+ {
+ $clone_root_cfg;
+ $rep_add "$rep/libbar.git#master";
+ $rep_fetch;
+
+ $* --output-root $~ libmbar/1.0.0 --output-purge 2>>~%EOE%;
+ checking out libmbar/1.0.0
+ %.+
+ distributing libmbar/1.0.0
+ checked out libmbar/1.0.0
+ EOE
+
+ test -f libmbar-1.0.0/manifest;
+
+ $pkg_purge libmbar
+ }
+ }
}