Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use <vcpkg-test/util.h> rather than <catch2/catch.hpp>. #1252

Merged
merged 1 commit into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ IncludeCategories:
Priority: -1
- Regex: '^<catch2/catch\.hpp>$'
Priority: 1
- Regex: '^<vcpkg-test/util\.h>$'
Priority: 1
- Regex: '^<vcpkg/base/fwd/.*\.h>$'
Priority: 2
- Regex: '^<vcpkg/fwd/.*\.h>$'
Expand Down
6 changes: 6 additions & 0 deletions include/vcpkg-test/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ namespace Catch
return "{\"" + value.first.native() + "\", \"" + value.second.native() + "\"}";
}
};

template<>
struct StringMaker<vcpkg::Version>
{
static const std::string convert(const vcpkg::Version& value) { return value.to_string(); }
};
}

namespace vcpkg
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/archives.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/archives.h>

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/arguments.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/strings.h>

Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/binarycaching.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/files.h>
#include <vcpkg/base/xmlserializer.h>
Expand All @@ -13,8 +13,6 @@

#include <string>

#include <vcpkg-test/util.h>

using namespace vcpkg;

struct KnowNothingBinaryProvider : IReadBinaryProvider
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/bundlesettings.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/format.h>
#include <vcpkg/base/strings.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/cache.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/cache.h>
#include <vcpkg/base/stringview.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/catch.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define CATCH_CONFIG_RUNNER
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/checks.h>
#include <vcpkg/base/messages.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/cgroup-parser.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/files.h>
#include <vcpkg/base/optional.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/chrono.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/chrono.h>

Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/ci-baseline.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/checks.h>
#include <vcpkg/base/parse.h>
Expand All @@ -10,8 +10,6 @@
#include <ostream>
#include <utility>

#include <vcpkg-test/util.h>

using namespace vcpkg;

namespace vcpkg
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/cmd-parser.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/cmd-parser.h>
#include <vcpkg/base/files.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/coffilereader.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/cofffilereader.h>

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/commands.dependinfo.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/commands.depend-info.h>
#include <vcpkg/vcpkgcmdarguments.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/commands.export.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/export.ifw.h>
#include <vcpkg/export.prefab.h>
Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/commands.extract.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/files.h>

Expand All @@ -8,8 +8,6 @@

#include <limits.h>

#include <vcpkg-test/util.h>

using namespace vcpkg;

#if defined(_WIN32)
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/commands.install.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/commands.install.h>

Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/configmetadata.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/json.h>
#include <vcpkg/base/jsonreader.h>
Expand All @@ -7,8 +7,6 @@
#include <vcpkg/configuration.h>
#include <vcpkg/registries.h>

#include <vcpkg-test/util.h>

using namespace vcpkg;

static constexpr StringLiteral KIND = "kind";
Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/configparser.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/util.h>

#include <vcpkg/binarycaching.h>

#include <vcpkg-test/util.h>

using namespace vcpkg;

#if defined(_WIN32)
Expand Down
3 changes: 1 addition & 2 deletions src/vcpkg-test/dependencies.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/fwd/packagespec.h>

Expand All @@ -17,7 +17,6 @@
#include <vector>

#include <vcpkg-test/mockcmakevarprovider.h>
#include <vcpkg-test/util.h>

using namespace vcpkg;

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/dependinfo-graphs.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/commands.depend-info.h>

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/downloads.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/downloads.h>
#include <vcpkg/base/expected.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/expected.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/expected.h>

Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/files.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <vcpkg/base/system-headers.h>

#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/files.h>
#include <vcpkg/base/strings.h>
Expand All @@ -9,8 +9,6 @@
#include <random>
#include <vector>

#include <vcpkg-test/util.h>

#if !defined(_WIN32)
#include <sys/stat.h>
#endif // ^^^ !_WIN32
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/git.parse.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/git.h>

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/hash.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/hash.h>

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/integrate.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/commands.install.h>

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/json.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/files.h>
#include <vcpkg/base/json.h>
Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/manifests.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/fwd/message_sinks.h>

Expand All @@ -10,8 +10,6 @@
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.h>

#include <vcpkg-test/util.h>

using namespace vcpkg;
using namespace vcpkg::Paragraphs;
using namespace vcpkg::Test;
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/messages.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/json.h>
#include <vcpkg/base/setup-messages.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/metrics.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/metrics.h>

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/new.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/json.h>

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/optional.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/lineinfo.h>
#include <vcpkg/base/optional.h>
Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/paragraph.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/strings.h>

#include <vcpkg/paragraphs.h>

#include <vcpkg-test/util.h>

namespace Strings = vcpkg::Strings;
using vcpkg::Paragraph;

Expand Down
3 changes: 1 addition & 2 deletions src/vcpkg-test/plan.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/graphs.h>

Expand All @@ -12,7 +12,6 @@
#include <vector>

#include <vcpkg-test/mockcmakevarprovider.h>
#include <vcpkg-test/util.h>

using namespace vcpkg;

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/registries.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/jsonreader.h>
#include <vcpkg/base/strings.h>
Expand Down
4 changes: 2 additions & 2 deletions src/vcpkg-test/spdx.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <vcpkg-test/util.h>

#include <vcpkg/dependencies.h>
#include <vcpkg/spdx.h>

#include <vcpkg-test/util.h>

using namespace vcpkg;

TEST_CASE ("spdx maximum serialization", "[spdx]")
Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/specifier.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/util.h>

#include <vcpkg/packagespec.h>

#include <vcpkg-test/util.h>

using namespace vcpkg;

TEST_CASE ("specifier conversion", "[specifier]")
Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/statusparagraphs.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/util.h>

#include <vcpkg/paragraphs.h>
#include <vcpkg/statusparagraphs.h>

#include <vcpkg-test/util.h>

using namespace vcpkg;
using namespace vcpkg::Paragraphs;
using namespace vcpkg::Test;
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/strings.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/api-stable-format.h>
#include <vcpkg/base/expected.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/stringview.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/stringview.h>

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/system.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <vcpkg/base/system-headers.h>

#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/optional.h>
#include <vcpkg/base/strings.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/system.mac.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/span.h>
#include <vcpkg/base/stringview.h>
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/system.process.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/strings.h>
#include <vcpkg/base/system.process.h>
Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg-test/tools.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <vcpkg-test/util.h>

#include <vcpkg/base/expected.h>

Expand All @@ -7,8 +7,6 @@

#include <array>

#include <vcpkg-test/util.h>

using namespace vcpkg;

TEST_CASE ("parse_tool_version_string", "[tools]")
Expand Down
Loading