aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-02-19 21:47:04 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-02-21 17:42:43 +0300
commit89dd478de7cf075beac69d0145df46f914cf35cf (patch)
treebe960f2406d087135c6456cff654de1f24a91557 /tests
parentd75d1d9e1c5b03b17fdea1fa3638db2bfe5e8d12 (diff)
Add support for pkg-checkout
Diffstat (limited to 'tests')
-rw-r--r--tests/common.test1
-rw-r--r--tests/common/git/state0/libbar.tarbin71680 -> 71680 bytes
-rw-r--r--tests/common/git/state0/libfoo.tarbin296960 -> 296960 bytes
-rw-r--r--tests/common/git/state0/style-basic.tarbin71680 -> 71680 bytes
-rw-r--r--tests/common/git/state0/style.tarbin133120 -> 133120 bytes
-rw-r--r--tests/common/git/state1/libbaz.tarbin61440 -> 61440 bytes
-rw-r--r--tests/common/git/state1/libfoo.tarbin378880 -> 378880 bytes
-rw-r--r--tests/common/git/state1/style-basic.tarbin71680 -> 71680 bytes
-rw-r--r--tests/common/git/state1/style.tarbin133120 -> 133120 bytes
-rw-r--r--tests/pkg-checkout.test96
l---------tests/pkg-checkout/git/libbar.tar1
l---------tests/pkg-checkout/git/style-basic0.tar1
l---------tests/pkg-checkout/git/style-basic1.tar1
-rw-r--r--tests/pkg-status.test1
14 files changed, 100 insertions, 1 deletions
diff --git a/tests/common.test b/tests/common.test
index 42234fb..b919da4 100644
--- a/tests/common.test
+++ b/tests/common.test
@@ -20,6 +20,7 @@ test.options += --build $recall($build.path)
#
cfg_create = $* cfg-create
pkg_build = $* pkg-build
+pkg_checkout = $* pkg-checkout
pkg_configure = $* pkg-configure
pkg_disfigure = $* pkg-disfigure
pkg_drop = $* pkg-drop
diff --git a/tests/common/git/state0/libbar.tar b/tests/common/git/state0/libbar.tar
index 1046f4b..23cc354 100644
--- a/tests/common/git/state0/libbar.tar
+++ b/tests/common/git/state0/libbar.tar
Binary files differ
diff --git a/tests/common/git/state0/libfoo.tar b/tests/common/git/state0/libfoo.tar
index d917a68..9b44d03 100644
--- a/tests/common/git/state0/libfoo.tar
+++ b/tests/common/git/state0/libfoo.tar
Binary files differ
diff --git a/tests/common/git/state0/style-basic.tar b/tests/common/git/state0/style-basic.tar
index a16e009..1579f50 100644
--- a/tests/common/git/state0/style-basic.tar
+++ b/tests/common/git/state0/style-basic.tar
Binary files differ
diff --git a/tests/common/git/state0/style.tar b/tests/common/git/state0/style.tar
index 0d40071..1b75bc5 100644
--- a/tests/common/git/state0/style.tar
+++ b/tests/common/git/state0/style.tar
Binary files differ
diff --git a/tests/common/git/state1/libbaz.tar b/tests/common/git/state1/libbaz.tar
index 74661aa..4bccb1a 100644
--- a/tests/common/git/state1/libbaz.tar
+++ b/tests/common/git/state1/libbaz.tar
Binary files differ
diff --git a/tests/common/git/state1/libfoo.tar b/tests/common/git/state1/libfoo.tar
index 276e6ba..dc9d53f 100644
--- a/tests/common/git/state1/libfoo.tar
+++ b/tests/common/git/state1/libfoo.tar
Binary files differ
diff --git a/tests/common/git/state1/style-basic.tar b/tests/common/git/state1/style-basic.tar
index ad067f4..c18148b 100644
--- a/tests/common/git/state1/style-basic.tar
+++ b/tests/common/git/state1/style-basic.tar
Binary files differ
diff --git a/tests/common/git/state1/style.tar b/tests/common/git/state1/style.tar
index 67bcb87..080dc4d 100644
--- a/tests/common/git/state1/style.tar
+++ b/tests/common/git/state1/style.tar
Binary files differ
diff --git a/tests/pkg-checkout.test b/tests/pkg-checkout.test
new file mode 100644
index 0000000..663a900
--- /dev/null
+++ b/tests/pkg-checkout.test
@@ -0,0 +1,96 @@
+# file : tests/pkg-checkout.test
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+.include common.test config.test remote-git.test
+
+# Source repository:
+#
+# pkg-checkout
+# `-- git
+# |-- libbar.git -> style-basic.git (prerequisite)
+# `-- style-basic.git
+
+# Prepare repositories used by tests if running in the local mode.
+#
++if ($remote != true)
+ # Create git repositories.
+ #
+ $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/***
+end
+
+: git-repos
+:
+if ($git_supported != true)
+{
+ # Skip git repository tests.
+ #
+}
+else
+{
+ rep = "$rep_git/state0"
+
+ rep_add += -d cfg 2>!
+ rep_fetch += -d cfg 2>!
+ pkg_configure += -d cfg 2>!
+ pkg_status += -d cfg
+
+ test.cleanups += &cfg/.bpkg/repositories/*/***
+
+ : unconfigured-dependency
+ :
+ $clone_root_cfg;
+ $rep_add "$rep/libbar.git#master";
+ $rep_fetch;
+
+ $* libmbar/1.0.0 2>>EOE != 0
+ error: no configured package satisfies dependency on style-basic >= 1.0.0
+ EOE
+
+ : configured-dependency
+ :
+ $clone_root_cfg;
+ $rep_add "$rep/libbar.git#master" && $rep_add "$rep/style-basic.git#master";
+ $rep_fetch;
+
+ $pkg_status style-basic | sed -n -e 's/available ([^ ]+).+/\1/p' | set v;
+
+ $* "style-basic/$v" 2>>"EOE" &cfg/style-basic-$v/***;
+ dist style-basic-$v
+ checked out style-basic/$v
+ EOE
+
+ $pkg_configure style-basic;
+
+ $* libmbar/1.0.0 2>>EOE &cfg/libmbar-1.0.0/***
+ dist libmbar-1.0.0
+ checked out libmbar/1.0.0
+ EOE
+
+ : 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_fetch;
+
+ $pkg_status style-basic | \
+ sed -n -e 's/available ([^ ]+) +([^ ]+).+/\1 \2/p' | set vs;
+
+ echo "$vs" | sed -e 's/([^ ]+).+/\1/' | set v0;
+ echo "$vs" | sed -e 's/([^ ]+) +([^ ]+)/\2/' | set v1;
+
+ $* "style-basic/$v0" 2>!;
+ $pkg_status style-basic >~"/unpacked $v0;.+/";
+
+ $* --replace "style-basic/$v1" 2>! &cfg/style-basic-$v1/***;
+ $pkg_status style-basic >~"/unpacked $v1;.+/"
+}
diff --git a/tests/pkg-checkout/git/libbar.tar b/tests/pkg-checkout/git/libbar.tar
new file mode 120000
index 0000000..67ccdb1
--- /dev/null
+++ b/tests/pkg-checkout/git/libbar.tar
@@ -0,0 +1 @@
+../../common/git/state0/libbar.tar \ No newline at end of file
diff --git a/tests/pkg-checkout/git/style-basic0.tar b/tests/pkg-checkout/git/style-basic0.tar
new file mode 120000
index 0000000..2833f83
--- /dev/null
+++ b/tests/pkg-checkout/git/style-basic0.tar
@@ -0,0 +1 @@
+../../common/git/state0/style-basic.tar \ No newline at end of file
diff --git a/tests/pkg-checkout/git/style-basic1.tar b/tests/pkg-checkout/git/style-basic1.tar
new file mode 120000
index 0000000..6db2c2f
--- /dev/null
+++ b/tests/pkg-checkout/git/style-basic1.tar
@@ -0,0 +1 @@
+../../common/git/state1/style-basic.tar \ No newline at end of file
diff --git a/tests/pkg-status.test b/tests/pkg-status.test
index 511cab2..9a72784 100644
--- a/tests/pkg-status.test
+++ b/tests/pkg-status.test
@@ -183,7 +183,6 @@ if ($git_supported != true)
else
{
rep = "$rep_git/state0"
- rep_add += -d cfg 2>!
test.cleanups += &cfg/.bpkg/repositories/*/***
: complement-cycle