diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-08 15:24:30 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-09 14:52:31 +0300 |
commit | 6018f3c1eadd5c60902aa5cf4f926ff17cbaf8ab (patch) | |
tree | 129e1c23e97bc7f86858a85cbc431449f799b5d6 /tests/manifest/driver.cxx | |
parent | b2bd3dc5f992b1898061e6836ea2b8b04ec243f1 (diff) |
Check parsed package manifests for duplicates
Diffstat (limited to 'tests/manifest/driver.cxx')
-rw-r--r-- | tests/manifest/driver.cxx | 42 |
1 files changed, 26 insertions, 16 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; } |