aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-11-11 19:47:56 -0800
committerRobert Schumacher <roschuma@microsoft.com>2017-11-11 19:47:56 -0800
commitecd21d6cb429a91076c0fc1bb3c6d4af447343e8 (patch)
tree31fd9fb1c803686339d0ce12c9a9d9eda0703e7c /toolsrc/include
parent492b9448a7d91e801f4eed9f4eba1be0f888a73c (diff)
downloadvcpkg-ecd21d6cb429a91076c0fc1bb3c6d4af447343e8.tar.gz
vcpkg-ecd21d6cb429a91076c0fc1bb3c6d4af447343e8.zip
[vcpkg-tests] Use PCH.
[vcpkg-update] Fix feature packages with update command. Fixes #2003.
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/tests.pch.h18
-rw-r--r--toolsrc/include/tests.utils.h26
-rw-r--r--toolsrc/include/vcpkg/base/sortedvector.h2
-rw-r--r--toolsrc/include/vcpkg/update.h3
-rw-r--r--toolsrc/include/vcpkg/versiont.h3
5 files changed, 50 insertions, 2 deletions
diff --git a/toolsrc/include/tests.pch.h b/toolsrc/include/tests.pch.h
new file mode 100644
index 000000000..0037af585
--- /dev/null
+++ b/toolsrc/include/tests.pch.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <CppUnitTest.h>
+
+#include <vcpkg/base/sortedvector.h>
+#include <vcpkg/base/strings.h>
+#include <vcpkg/base/util.h>
+#include <vcpkg/binaryparagraph.h>
+#include <vcpkg/dependencies.h>
+#include <vcpkg/packagespec.h>
+#include <vcpkg/packagespecparseresult.h>
+#include <vcpkg/paragraphs.h>
+#include <vcpkg/sourceparagraph.h>
+#include <vcpkg/statusparagraph.h>
+#include <vcpkg/statusparagraphs.h>
+#include <vcpkg/triplet.h>
+#include <vcpkg/update.h>
+#include <vcpkg/vcpkgcmdarguments.h>
diff --git a/toolsrc/include/tests.utils.h b/toolsrc/include/tests.utils.h
new file mode 100644
index 000000000..485b8c294
--- /dev/null
+++ b/toolsrc/include/tests.utils.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <CppUnitTest.h>
+
+#include <vcpkg/dependencies.h>
+#include <vcpkg/packagespec.h>
+#include <vcpkg/packagespecparseresult.h>
+#include <vcpkg/statusparagraph.h>
+
+#include <memory>
+
+namespace Microsoft::VisualStudio::CppUnitTestFramework
+{
+ std::wstring ToString(const vcpkg::Dependencies::InstallPlanType& t);
+ std::wstring ToString(const vcpkg::Dependencies::RequestType& t);
+ std::wstring ToString(const vcpkg::PackageSpecParseResult& t);
+ std::wstring ToString(const vcpkg::PackageSpec& t);
+}
+
+std::unique_ptr<vcpkg::StatusParagraph> make_status_pgh(const char* name,
+ const char* depends = "",
+ const char* triplet = "x86-windows");
+std::unique_ptr<vcpkg::StatusParagraph> make_status_feature_pgh(const char* name,
+ const char* feature,
+ const char* depends = "",
+ const char* triplet = "x86-windows"); \ No newline at end of file
diff --git a/toolsrc/include/vcpkg/base/sortedvector.h b/toolsrc/include/vcpkg/base/sortedvector.h
index 62808cc2f..fbb7e5a5a 100644
--- a/toolsrc/include/vcpkg/base/sortedvector.h
+++ b/toolsrc/include/vcpkg/base/sortedvector.h
@@ -44,6 +44,8 @@ namespace vcpkg
size_type size() const { return this->m_data.size(); }
+ const T& operator[](int i) const { return this->m_data[i]; }
+
private:
std::vector<T> m_data;
};
diff --git a/toolsrc/include/vcpkg/update.h b/toolsrc/include/vcpkg/update.h
index e7303d1b0..7587b9eb2 100644
--- a/toolsrc/include/vcpkg/update.h
+++ b/toolsrc/include/vcpkg/update.h
@@ -16,6 +16,7 @@ namespace vcpkg::Update
VersionDiff version_diff;
};
- std::vector<OutdatedPackage> find_outdated_packages(const VcpkgPaths& paths, const StatusParagraphs& status_db);
+ std::vector<OutdatedPackage> find_outdated_packages(const std::map<std::string, VersionT>& src_names_to_versions,
+ const StatusParagraphs& status_db);
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
} \ No newline at end of file
diff --git a/toolsrc/include/vcpkg/versiont.h b/toolsrc/include/vcpkg/versiont.h
index 67efd8da3..6d8332521 100644
--- a/toolsrc/include/vcpkg/versiont.h
+++ b/toolsrc/include/vcpkg/versiont.h
@@ -8,8 +8,9 @@ namespace vcpkg
VersionT();
VersionT(const std::string& value);
- std::string to_string() const;
+ const std::string& to_string() const;
+ private:
std::string value;
};