aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/common/git/init5
-rw-r--r--tests/common/git/state0/libbar.tarbin81920 -> 174080 bytes
-rw-r--r--tests/common/git/state0/libfoo.tarbin327680 -> 440320 bytes
-rw-r--r--tests/common/git/state0/libfox.tarbin143360 -> 245760 bytes
-rw-r--r--tests/common/git/state0/links.tarbin276480 -> 276480 bytes
-rw-r--r--tests/common/git/state0/style-basic.tarbin71680 -> 81920 bytes
-rw-r--r--tests/common/git/state0/style.tarbin143360 -> 143360 bytes
-rw-r--r--tests/common/git/state1/libbaz.tarbin61440 -> 61440 bytes
-rw-r--r--tests/common/git/state1/libfoo.tarbin409600 -> 501760 bytes
-rw-r--r--tests/common/git/state1/libfox.tarbin143360 -> 245760 bytes
-rw-r--r--tests/common/git/state1/style-basic.tarbin71680 -> 81920 bytes
-rw-r--r--tests/common/git/state1/style.tarbin143360 -> 143360 bytes
-rw-r--r--tests/pkg-checkout.testscript7
-rw-r--r--tests/rep-fetch-git-refname.testscript5
-rw-r--r--tests/rep-fetch.testscript4
-rw-r--r--tests/rep-info.testscript196
16 files changed, 154 insertions, 63 deletions
diff --git a/tests/common/git/init b/tests/common/git/init
index 5153175..9519779 100755
--- a/tests/common/git/init
+++ b/tests/common/git/init
@@ -65,6 +65,8 @@ rm -f libfox.git/.gitmodules
rm -f -r libfox.git/libbar
rm -f -r libbar.git/.git
+rm -f libbar.git/.gitmodules
+rm -f -r libbar.git/extras
rm -f -r style.git/.git
rm -f -r style.git/basic
@@ -85,7 +87,7 @@ git -C style-basic.git commit -am 'Create'
sleep 1 # Make sure that master commits are older than stable commits.
git -C style-basic.git branch stable
git -C style-basic.git checkout stable
-touch style-basic.git/README
+echo "TODO" >style-basic.git/README
cat <<EOF >style-basic.git/repositories.manifest
: 1
email: user@example.com
@@ -112,6 +114,7 @@ git -C style-basic.git checkout master
#
git -C libbar.git init
git -C libbar.git add '*'
+git -C libbar.git submodule add -b stable ../style-basic.git extras
git -C libbar.git commit -am 'Create'
# Create master branch for libfoo.git, adding style.git and libbar.git as
diff --git a/tests/common/git/state0/libbar.tar b/tests/common/git/state0/libbar.tar
index 027112c..b63a7b5 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 96a9f5b..200ebf5 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/libfox.tar b/tests/common/git/state0/libfox.tar
index fc2c391..df77539 100644
--- a/tests/common/git/state0/libfox.tar
+++ b/tests/common/git/state0/libfox.tar
Binary files differ
diff --git a/tests/common/git/state0/links.tar b/tests/common/git/state0/links.tar
index 33c5dbf..25c4089 100644
--- a/tests/common/git/state0/links.tar
+++ b/tests/common/git/state0/links.tar
Binary files differ
diff --git a/tests/common/git/state0/style-basic.tar b/tests/common/git/state0/style-basic.tar
index 8b57bd0..7223c52 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 56e29f0..93007d5 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 7acf277..d46b25c 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 532e974..683f5ab 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/libfox.tar b/tests/common/git/state1/libfox.tar
index ec49a86..49c4752 100644
--- a/tests/common/git/state1/libfox.tar
+++ b/tests/common/git/state1/libfox.tar
Binary files differ
diff --git a/tests/common/git/state1/style-basic.tar b/tests/common/git/state1/style-basic.tar
index 1946606..5ab346d 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 769b6d5..71be292 100644
--- a/tests/common/git/state1/style.tar
+++ b/tests/common/git/state1/style.tar
Binary files differ
diff --git a/tests/pkg-checkout.testscript b/tests/pkg-checkout.testscript
index a284f6b..86ae341 100644
--- a/tests/pkg-checkout.testscript
+++ b/tests/pkg-checkout.testscript
@@ -55,7 +55,8 @@ else
$rep_add "$rep/libbar.git#master";
$rep_fetch;
- $* libmbar/1.0.0 2>>EOE != 0
+ $* libmbar/1.0.0 2>>~%EOE% != 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
@@ -78,7 +79,9 @@ else
$pkg_configure style-basic;
- $* libmbar/1.0.0 2>>EOE;
+ $* libmbar/1.0.0 2>>~%EOE%;
+ checking out libmbar/1.0.0
+ %.+
distributing libmbar/1.0.0
checked out libmbar/1.0.0
EOE
diff --git a/tests/rep-fetch-git-refname.testscript b/tests/rep-fetch-git-refname.testscript
index 71305ea..37fdcba 100644
--- a/tests/rep-fetch-git-refname.testscript
+++ b/tests/rep-fetch-git-refname.testscript
@@ -62,6 +62,7 @@
warn1 = '%.{0}';
warn2 = '%.{0}';
warn3 = '%.{0}';
+ warn4 = '%.{0}';
if ($git_protocol == 'local' || \
$git_protocol == 'https-smart' || \
@@ -72,6 +73,7 @@
warn1 = "$warn_ref_hist for submodule 'doc/style'$reason_dumb$warn_dumb"
warn2 = "$warn_repo_hist for submodule 'doc/style/basic'$reason_dumb$warn_dumb"
warn3 = "$warn_ref_hist for submodule 'libbar'$reason_dumb$warn_dumb"
+ warn4 = "$warn_ref_hist for submodule 'libbar/extras'$reason_dumb$warn_dumb"
end;
$pkg_checkout libfoo/1.0.0 2>>~"%EOE%";
@@ -88,6 +90,9 @@
%fetching submodule 'libbar' from .+libbar\.git%
$warn3
%submodule path 'libbar': checked out .+%
+ %fetching submodule 'libbar/extras' from .+style-basic\.git+%
+ $warn4
+ %submodule path 'libbar/extras': checked out .+%
distributing libfoo/1.0.0
checked out libfoo/1.0.0
EOE
diff --git a/tests/rep-fetch.testscript b/tests/rep-fetch.testscript
index bd67bc1..8e7011a 100644
--- a/tests/rep-fetch.testscript
+++ b/tests/rep-fetch.testscript
@@ -792,6 +792,10 @@ else
%fetching submodule 'libbar' from .+libbar\.git%
%warning: .+%{0,2}
%submodule path 'libbar': checked out '.+'%
+ %querying .+style-basic\.git%?
+ %fetching submodule 'libbar/extras' from .+style-basic\.git%
+ %warning: .+%{0,2}
+ %submodule path 'libbar/extras': checked out '.+'%
2 package(s) in 1 repository(s)
EOE
}
diff --git a/tests/rep-info.testscript b/tests/rep-info.testscript
index f72d9d4..1a28dd9 100644
--- a/tests/rep-info.testscript
+++ b/tests/rep-info.testscript
@@ -44,12 +44,14 @@ end
test.options += --auth all --trust-yes
+posix = ($cxx.target.class != 'windows')
+
: no-location
:
$* 2>>EOE != 0
-error: repository location argument expected
- info: run 'bpkg help rep-info' for more information
-EOE
+ error: repository location argument expected
+ info: run 'bpkg help rep-info' for more information
+ EOE
: default
:
@@ -57,24 +59,24 @@ EOE
: unsigned
:
$* $rep/testing >>"EOO"
- pkg:build2.org/rep-info/testing ($rep/testing)
- prerequisite pkg:build2.org/foo/testing ($rep_root/foo/testing)
- complement pkg:build2.org/rep-info/stable ($rep/stable)
+ pkg:build2.org/rep-info/testing ($rep/testing)
+ prerequisite pkg:build2.org/foo/testing ($rep_root/foo/testing)
+ complement pkg:build2.org/rep-info/stable ($rep/stable)
- foo/1
- EOO
+ foo/1
+ EOO
: signed
:
$* $rep/signed >>"EOO"
- pkg:build2.org/rep-info/signed ($rep/signed)
- CN=build2.org/O=Code Synthesis/info@build2.org
- $cert_fp
- prerequisite pkg:build2.org/foo/testing ($rep_root/foo/testing)
- complement pkg:build2.org/rep-info/stable ($rep/stable)
-
- foo/1
- EOO
+ pkg:build2.org/rep-info/signed ($rep/signed)
+ CN=build2.org/O=Code Synthesis/info@build2.org
+ $cert_fp
+ prerequisite pkg:build2.org/foo/testing ($rep_root/foo/testing)
+ complement pkg:build2.org/rep-info/stable ($rep/stable)
+
+ foo/1
+ EOO
}
: name
@@ -88,24 +90,96 @@ $* --name $rep/testing >"pkg:build2.org/rep-info/testing ($rep/testing)"
: list
:
- $* $rep/testing >>EOO
+ $* $rep/testing >>EOO
- foo/1
- EOO
+ foo/1
+ EOO
: manifest
:
- $* --manifest $rep/testing >>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
+ {
+ test.arguments += --manifest
+
+ : basic
+ :
+ $* $rep/testing >>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
+
+ : deep
+ :
+ {
+ test.arguments += --deep
+
+ : dir
+ :
+ {
+ tar ($posix ? : --force-local) -xf $src/git/libbar.tar &state0/***;
+
+ $* --type dir "state0/libbar.git" >>~%EOO%d;
+ : 1
+ name: libbar
+ version: 1.0.0
+ summary: libbar
+ license: MIT
+ description: \
+ TODO
+
+ \
+ description-type: text/plain
+ %.+
+ EOO
+
+ rm state0/libbar.git/libbar/README;
+
+ $* --type dir "state0/libbar.git" 2>>/~%EOE% != 0
+ %error: unable to read from libbar/README referenced by description-file manifest value in libbar/manifest: .+%
+ % info: repository .+%
+ EOE
+ }
+
+ : git
+ :
+ : Enable on Windows if/when we make *-file values expansion to properly
+ : work for symlinks on Windows (see rep_fetch_git() for details).
+ :
+ if ($git_supported && $posix)
+ {
+ $* "$rep_git/state0/libbar.git#master" >>~%EOO%d 2>!
+ : 1
+ name: libbar
+ version: 1.0.0
+ summary: libbar
+ license: MIT
+ description: \
+ TODO
+
+ \
+ description-type: text/plain
+ %.+
+ :
+ name: libmbar
+ version: 1.0.0
+ summary: libmbar
+ license: MIT
+ description: \
+ TODO
+
+ \
+ description-type: text/plain
+ %.+
+ EOO
+ }
+ }
+ }
: to-file
:
@@ -113,9 +187,9 @@ $* --name $rep/testing >"pkg:build2.org/rep-info/testing ($rep/testing)"
: 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
+ error: --packages-file specified without --manifest
+ info: run 'bpkg help rep-info' for more information
+ EOE
: manifest
:
@@ -147,23 +221,23 @@ $* --name $rep/testing >"pkg:build2.org/rep-info/testing ($rep/testing)"
: list
:
$* $rep/testing >>"EOO"
- prerequisite pkg:build2.org/foo/testing ($rep_root/foo/testing)
- complement pkg:build2.org/rep-info/stable ($rep/stable)
- EOO
+ prerequisite pkg:build2.org/foo/testing ($rep_root/foo/testing)
+ complement pkg:build2.org/rep-info/stable ($rep/stable)
+ EOO
: manifest
:
$* --manifest $rep/testing >>EOO
- : 1
- location: ../../foo/testing
- type: pkg
- role: prerequisite
- :
- location: ../stable
- type: pkg
- role: complement
- :
- EOO
+ : 1
+ location: ../../foo/testing
+ type: pkg
+ role: prerequisite
+ :
+ location: ../stable
+ type: pkg
+ role: complement
+ :
+ EOO
: to-file
:
@@ -171,9 +245,9 @@ $* --name $rep/testing >"pkg:build2.org/rep-info/testing ($rep/testing)"
: 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
+ error: --repositories-file specified without --manifest
+ info: run 'bpkg help rep-info' for more information
+ EOE
: manifest
:
@@ -223,10 +297,10 @@ else
: Version module is enabled for the project.
:
$* "$rep/style-basic.git#master" >>~%EOO%
- %git:.+style-basic#master .+style-basic.git#master%
+ %git:.+style-basic#master .+style-basic.git#master%
- %style-basic/1\.1\.0-a\.0\.\d+\..+%
- EOO
+ %style-basic/1\.1\.0-a\.0\.\d+\..+%
+ EOO
: manifest-lists
:
@@ -234,12 +308,12 @@ else
: repository root.
:
$* "$rep/libbar.git#master" >>~%EOO%
- %git:.+libbar#master .+libbar.git#master%
- %prerequisite git:.+style-basic#stable .+style-basic.git#stable%
+ %git:.+libbar#master .+libbar.git#master%
+ %prerequisite git:.+style-basic#stable .+style-basic.git#stable%
- libbar/1.0.0
- libmbar/1.0.0
- EOO
+ libbar/1.0.0
+ libmbar/1.0.0
+ EOO
: repository-manifests
:
@@ -248,9 +322,9 @@ else
: master branch.
:
$* -r --manifest "$rep/style-basic.git#stable,master" >>~%EOO%
- : 1
- email: user@example.com
- EOO
+ : 1
+ email: user@example.com
+ EOO
: complete-dependency
:
@@ -260,6 +334,7 @@ else
version: 1.0.0
summary: libbar
license: MIT
+ description-file: README
url: http://example.org/libbar
email: pkg@example.org
depends: style-basic >= 1.0.0
@@ -270,6 +345,7 @@ else
version: 1.0.0
summary: libmbar
license: MIT
+ description-file: README
url: http://example.org/libmbar
email: pkg@example.org
depends: style-basic >= 1.0.0