aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg-test/commands.cpp
diff options
context:
space:
mode:
authorBilly O'Neal <bion@microsoft.com>2021-02-04 10:15:44 -0800
committerGitHub <noreply@github.com>2021-02-04 10:15:44 -0800
commitaa60b7efa56a83ead743718941d8b320ef4a05af (patch)
treedb9f9ebd6fa37598b2f5f2ad564eb858cdeddcb0 /toolsrc/src/vcpkg-test/commands.cpp
parentf226416d2eafc495dd03572cb61542fb1670ffdc (diff)
downloadvcpkg-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/commands.cpp')
-rw-r--r--toolsrc/src/vcpkg-test/commands.cpp83
1 files changed, 0 insertions, 83 deletions
diff --git a/toolsrc/src/vcpkg-test/commands.cpp b/toolsrc/src/vcpkg-test/commands.cpp
deleted file mode 100644
index 1a582beb3..000000000
--- a/toolsrc/src/vcpkg-test/commands.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-#include <catch2/catch.hpp>
-
-#include <vcpkg/commands.contact.h>
-#include <vcpkg/commands.h>
-#include <vcpkg/commands.upload-metrics.h>
-#include <vcpkg/commands.version.h>
-
-#include <stddef.h>
-
-using namespace vcpkg;
-
-namespace
-{
- template<class CommandListT, size_t ExpectedCount>
- void check_all_commands(const CommandListT& actual_commands, const char* const (&expected_commands)[ExpectedCount])
- {
- CHECK(actual_commands.size() == ExpectedCount); // makes sure this test is updated if we add a command
- for (const char* expected_command : expected_commands)
- {
- CHECK(Commands::find(StringView{expected_command, strlen(expected_command)}, actual_commands) != nullptr);
- }
-
- CHECK(Commands::find("x-never-will-exist", actual_commands) == nullptr);
- }
-} // unnamed namespace
-
-// clang-format tries to wrap the following lists inappropriately
-
-// clang-format off
-TEST_CASE ("get_available_basic_commands works", "[commands]")
-{
- check_all_commands(Commands::get_available_basic_commands(), {
- "contact",
- "version",
-#if defined(_WIN32)
- "x-upload-metrics",
-#endif // defined(_WIN32)
- });
-}
-
-TEST_CASE ("get_available_paths_commands works", "[commands]")
-{
- check_all_commands(Commands::get_available_paths_commands(), {
- "/?",
- "help",
- "search",
- "list",
- "integrate",
- "owns",
- "update",
- "edit",
- "create",
- "cache",
- "portsdiff",
- "autocomplete",
- "hash",
- "fetch",
- "format-manifest",
- "x-ci-clean",
- "x-history",
- "x-package-info",
- "x-vsinstances",
- "x-ci-verify-versions",
- "x-add-version",
- });
-}
-
-TEST_CASE ("get_available_commands_type_a works", "[commands]")
-{
- check_all_commands(Commands::get_available_triplet_commands(), {
- "install",
- "x-set-installed",
- "ci",
- "remove",
- "upgrade",
- "build",
- "env",
- "build-external",
- "export",
- "depend-info",
- });
-}
-// clang-format on