diff options
| author | Billy O'Neal <bion@microsoft.com> | 2021-02-04 10:15:44 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-04 10:15:44 -0800 |
| commit | aa60b7efa56a83ead743718941d8b320ef4a05af (patch) | |
| tree | db9f9ebd6fa37598b2f5f2ad564eb858cdeddcb0 /toolsrc/src/vcpkg-test/update.cpp | |
| parent | f226416d2eafc495dd03572cb61542fb1670ffdc (diff) | |
| download | vcpkg-aa60b7efa56a83ead743718941d8b320ef4a05af.tar.gz vcpkg-aa60b7efa56a83ead743718941d8b320ef4a05af.zip | |
[vcpkg] Download vcpkg.exe rather than building it in bootstrap on Windows. (#15474)
This reduces bootstrap cost for Windows customers, resolving the issue initially submitted as #12502 .
The `toolsrc` tree was extracted to https://github.com/microsoft/vcpkg-tool. `bootstrap.sh` was changed to download the right source tarball, extract, and build it. This was chosen over the previous attempt, a submodule, over concerns of accidentally destroying people's local modifications.
Diffstat (limited to 'toolsrc/src/vcpkg-test/update.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg-test/update.cpp | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/toolsrc/src/vcpkg-test/update.cpp b/toolsrc/src/vcpkg-test/update.cpp deleted file mode 100644 index bce663d28..000000000 --- a/toolsrc/src/vcpkg-test/update.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include <catch2/catch.hpp> - -#include <vcpkg/base/sortedvector.h> - -#include <vcpkg/portfileprovider.h> -#include <vcpkg/statusparagraphs.h> -#include <vcpkg/update.h> - -#include <vcpkg-test/util.h> - -using namespace vcpkg; -using namespace vcpkg::Update; -using namespace vcpkg::Test; - -using Pgh = std::vector<std::unordered_map<std::string, std::string>>; - -TEST_CASE ("find outdated packages basic", "[update]") -{ - std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs; - status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.version = "2"; - - StatusParagraphs status_db(std::move(status_paragraphs)); - - std::unordered_map<std::string, SourceControlFileLocation> map; - auto scf = unwrap(test_parse_control_file({{{"Source", "a"}, {"Version", "0"}}})); - map.emplace("a", SourceControlFileLocation{std::move(scf), ""}); - PortFileProvider::MapPortFileProvider provider(map); - - auto pkgs = SortedVector<OutdatedPackage>(Update::find_outdated_packages(provider, status_db), - &OutdatedPackage::compare_by_name); - - REQUIRE(pkgs.size() == 1); - REQUIRE(pkgs[0].version_diff.left.to_string() == "2"); - REQUIRE(pkgs[0].version_diff.right.to_string() == "0"); -} - -TEST_CASE ("find outdated packages features", "[update]") -{ - std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs; - status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.version = "2"; - - status_paragraphs.push_back(make_status_feature_pgh("a", "b")); - status_paragraphs.back()->package.version = "2"; - - StatusParagraphs status_db(std::move(status_paragraphs)); - - std::unordered_map<std::string, SourceControlFileLocation> map; - auto scf = unwrap(test_parse_control_file({{{"Source", "a"}, {"Version", "0"}}})); - map.emplace("a", SourceControlFileLocation{std::move(scf), ""}); - PortFileProvider::MapPortFileProvider provider(map); - - auto pkgs = SortedVector<OutdatedPackage>(Update::find_outdated_packages(provider, status_db), - &OutdatedPackage::compare_by_name); - - REQUIRE(pkgs.size() == 1); - REQUIRE(pkgs[0].version_diff.left.to_string() == "2"); - REQUIRE(pkgs[0].version_diff.right.to_string() == "0"); -} - -TEST_CASE ("find outdated packages features 2", "[update]") -{ - std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs; - status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.version = "2"; - - status_paragraphs.push_back(make_status_feature_pgh("a", "b")); - status_paragraphs.back()->package.version = "0"; - status_paragraphs.back()->state = InstallState::NOT_INSTALLED; - status_paragraphs.back()->want = Want::PURGE; - - StatusParagraphs status_db(std::move(status_paragraphs)); - - std::unordered_map<std::string, SourceControlFileLocation> map; - auto scf = unwrap(test_parse_control_file({{{"Source", "a"}, {"Version", "0"}}})); - map.emplace("a", SourceControlFileLocation{std::move(scf), ""}); - PortFileProvider::MapPortFileProvider provider(map); - - auto pkgs = SortedVector<OutdatedPackage>(Update::find_outdated_packages(provider, status_db), - &OutdatedPackage::compare_by_name); - - REQUIRE(pkgs.size() == 1); - REQUIRE(pkgs[0].version_diff.left.to_string() == "2"); - REQUIRE(pkgs[0].version_diff.right.to_string() == "0"); -} - -TEST_CASE ("find outdated packages none", "[update]") -{ - std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs; - status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.version = "2"; - - StatusParagraphs status_db(std::move(status_paragraphs)); - - std::unordered_map<std::string, SourceControlFileLocation> map; - auto scf = unwrap(test_parse_control_file({{{"Source", "a"}, {"Version", "2"}}})); - map.emplace("a", SourceControlFileLocation{std::move(scf), ""}); - PortFileProvider::MapPortFileProvider provider(map); - - auto pkgs = SortedVector<OutdatedPackage>(Update::find_outdated_packages(provider, status_db), - &OutdatedPackage::compare_by_name); - - REQUIRE(pkgs.size() == 0); -} |
