diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manifest/driver.cxx | 14 | ||||
-rw-r--r-- | tests/manifest/testscript | 31 | ||||
-rw-r--r-- | tests/repository-location/driver.cxx | 14 |
3 files changed, 55 insertions, 4 deletions
diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx index caca79d..5e028bf 100644 --- a/tests/manifest/driver.cxx +++ b/tests/manifest/driver.cxx @@ -16,16 +16,18 @@ using namespace std; using namespace butl; using namespace bpkg; -// Usage: argv[0] (-p|-r|-s) +// Usage: argv[0] (-pp|-dp|-gp|-pr|-dr|-gr|-s) // // Read and parse manifest from STDIN and serialize it to STDOUT. The // following options specify the manifest type. // // -pp parse pkg package manifest list +// -dp parse dir package manifest list // -gp parse git package manifest list // -pr parse pkg repository manifest list +// -dr parse dir repository manifest list // -gr parse git repository manifest list -// -s parse signature manifest +// -s parse signature manifest // int main (int argc, char* argv[]) @@ -41,10 +43,14 @@ main (int argc, char* argv[]) if (opt == "-pp") pkg_package_manifests (p).serialize (s); - else if (opt == "-pr") - pkg_repository_manifests (p).serialize (s); + else if (opt == "-dp") + dir_package_manifests (p).serialize (s); else if (opt == "-gp") git_package_manifests (p).serialize (s); + else if (opt == "-pr") + pkg_repository_manifests (p).serialize (s); + else if (opt == "-dr") + dir_repository_manifests (p).serialize (s); else if (opt == "-gr") git_repository_manifests (p).serialize (s); else if (opt == "-s") diff --git a/tests/manifest/testscript b/tests/manifest/testscript index 68ceced..b72f492 100644 --- a/tests/manifest/testscript +++ b/tests/manifest/testscript @@ -260,6 +260,37 @@ url: http://cppget.org EOO } + + : dir + : + { + : manifest + : + : Roundtrip the dir repository manifest list. + : + $* -dr <<EOF >>EOF + : 1 + location: ../stable + type: dir + role: complement + : + EOF + + : prerequisite-with-fragment + : + $* -dr <<EOI >>EOO + : 1 + location: ../stable.git#stable + role: complement + : + EOI + : 1 + location: ../stable.git + type: dir + role: complement + : + EOO + } } : signature diff --git a/tests/repository-location/driver.cxx b/tests/repository-location/driver.cxx index 89a32f8..014b810 100644 --- a/tests/repository-location/driver.cxx +++ b/tests/repository-location/driver.cxx @@ -201,6 +201,10 @@ namespace bpkg assert (bad_loc ("file:/abc", repository_type::git)); #endif + // Can't be remote. + // + assert (bad_loc ("http://example.com/dir", repository_type::dir)); + // Invalid web interface URL. // assert (bad_url (".a/..", loc ("http://stable.cppget.org/1/misc"))); @@ -321,6 +325,11 @@ namespace bpkg assert (l.string () == "file:/#master"); assert (l.canonical_name () == "git:/#master"); } + { + repository_location l (loc ("/home/user/repo", repository_type::dir)); + assert (l.string () == "/home/user/repo"); + assert (l.canonical_name () == "dir:/home/user/repo"); + } #else { repository_location l (loc ("c:\\1\\aa\\bb", loc ())); @@ -388,6 +397,11 @@ namespace bpkg assert (l.string () == "file:/c:#master"); assert (l.canonical_name () == "git:c:#master"); } + { + repository_location l (loc ("c:\\user\\repo", repository_type::dir)); + assert (l.string () == "c:\\user\\repo"); + assert (l.canonical_name () == "dir:c:\\user\\repo"); + } #endif { repository_location l (loc ("../c/../c/./1/aa/../bb", loc ())); |