aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_ci.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-02-15 14:34:39 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2017-02-15 18:06:06 -0800
commitdbd8e5c56de12beb7626a7782f54b591b6154aa4 (patch)
treed027f7b05d97eca9d84668a26b722d19f83ba9fb /toolsrc/src/commands_ci.cpp
parentab2cca3dad9d7efdc87e40554ccb6dc582d22360 (diff)
downloadvcpkg-dbd8e5c56de12beb7626a7782f54b591b6154aa4.tar.gz
vcpkg-dbd8e5c56de12beb7626a7782f54b591b6154aa4.zip
Print only non-SUCCEEDED packages and also show summary
Diffstat (limited to 'toolsrc/src/commands_ci.cpp')
-rw-r--r--toolsrc/src/commands_ci.cpp37
1 files changed, 30 insertions, 7 deletions
diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp
index dd42335df..496ae6146 100644
--- a/toolsrc/src/commands_ci.cpp
+++ b/toolsrc/src/commands_ci.cpp
@@ -12,6 +12,7 @@ namespace vcpkg::Commands::CI
{
using Dependencies::package_spec_with_install_plan;
using Dependencies::install_plan_type;
+ using Build::BuildResult;
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet)
{
@@ -37,10 +38,9 @@ namespace vcpkg::Commands::CI
std::vector<package_spec_with_install_plan> install_plan = Dependencies::create_install_plan(paths, specs, status_db);
Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty");
- std::vector<Build::BuildResult> results;
-
Environment::ensure_utilities_on_path(paths);
+ std::vector<BuildResult> results;
Stopwatch stopwatch = Stopwatch::createStarted();
for (const package_spec_with_install_plan& action : install_plan)
{
@@ -49,14 +49,14 @@ namespace vcpkg::Commands::CI
{
if (action.plan.plan_type == install_plan_type::ALREADY_INSTALLED)
{
- results.push_back(Build::BuildResult::SUCCEEDED);
+ results.push_back(BuildResult::SUCCEEDED);
System::println(System::color::success, "Package %s is already installed", action.spec);
}
else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL)
{
- const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), status_db);
+ const BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), status_db);
results.push_back(result);
- if (result != Build::BuildResult::SUCCEEDED)
+ if (result != BuildResult::SUCCEEDED)
{
System::println(System::color::error, Build::create_error_message(result, action.spec));
continue;
@@ -67,7 +67,7 @@ namespace vcpkg::Commands::CI
}
else if (action.plan.plan_type == install_plan_type::INSTALL)
{
- results.push_back(Build::BuildResult::SUCCEEDED);
+ results.push_back(BuildResult::SUCCEEDED);
Install::install_package(paths, *action.plan.binary_pgh, &status_db);
System::println(System::color::success, "Package %s is installed", action.spec);
}
@@ -81,12 +81,35 @@ namespace vcpkg::Commands::CI
}
}
+ System::println(stopwatch.toString());
+
for (int i = 0; i < results.size(); i++)
{
+ if (results[i] == BuildResult::SUCCEEDED)
+ {
+ continue;
+ }
+
System::println("%s: %s", install_plan[i].spec.toString(), Build::to_string(results[i]));
}
- System::println(stopwatch.toString());
+ std::map<BuildResult, int> summary;
+ for (const BuildResult& v : Build::BuildResult_values)
+ {
+ summary[v] = 0;
+ }
+
+ for (const BuildResult& r : results)
+ {
+ summary[r]++;
+ }
+
+ System::println("\n\nSUMMARY");
+ for (const std::pair<const BuildResult, int>& entry : summary)
+ {
+ System::println(" %s: %d", Build::to_string(entry.first), entry.second);
+ }
+
exit(EXIT_SUCCESS);
}
}