diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manifest/driver.cxx | 42 | ||||
-rw-r--r-- | tests/manifest/testscript | 23 |
2 files changed, 43 insertions, 22 deletions
diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx index 5e028bf..62f9d8f 100644 --- a/tests/manifest/driver.cxx +++ b/tests/manifest/driver.cxx @@ -41,20 +41,30 @@ main (int argc, char* argv[]) manifest_parser p (cin, "stdin"); manifest_serializer s (cout, "stdout"); - if (opt == "-pp") - pkg_package_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") - signature_manifest (p).serialize (s); - else - assert (false); + try + { + if (opt == "-pp") + pkg_package_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") + signature_manifest (p).serialize (s); + else + assert (false); + } + catch (const manifest_parsing& e) + { + cerr << e << endl; + return 1; + } + + return 0; } diff --git a/tests/manifest/testscript b/tests/manifest/testscript index b72f492..59f4db0 100644 --- a/tests/manifest/testscript +++ b/tests/manifest/testscript @@ -76,12 +76,18 @@ EOF } - : git + : dir : { - : manifest + : empty + : + : Roundtrip an empty dir package manifest list. + : + $* -gp <"" >:"" + + : non-empty : - : Roundtrip the git package manifest list. + : Roundtrip the dir package manifest list. : $* -gp <<EOF >>EOF : 1 @@ -90,11 +96,16 @@ location: mhello/ EOF - : empty + : duplicate : - : Roundtrip an empty git package manifest list. + $* -gp <<EOI 2>'stdin:5:1: error: duplicate package manifest' != 0 + : 1 + location: hello/ : - $* -gp <"" >:"" + location: hello/ + : + location: mhello/ + EOI } } |