Skip to content

Commit

Permalink
Consistently construct paths using host's separator (#250)
Browse files Browse the repository at this point in the history
* Consistently construct paths using host's separator

* Construct consistent test directory path
  • Loading branch information
dg0yt authored Nov 4, 2021
1 parent b801591 commit 1d3d3ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/vcpkg-test/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace vcpkg::Test
static Path internal_base_temporary_directory()
{
#if defined(_WIN32)
return vcpkg::get_environment_variable("TEMP").value_or_exit(VCPKG_LINE_INFO) + "/vcpkg-test";
return Path(vcpkg::get_environment_variable("TEMP").value_or_exit(VCPKG_LINE_INFO)) / "vcpkg-test";
#else
return "/tmp/vcpkg-test";
#endif
Expand Down
18 changes: 9 additions & 9 deletions src/vcpkg/postbuildlint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ namespace vcpkg::PostBuildLint

static LintStatus check_for_files_in_debug_include_directory(const Filesystem& fs, const Path& package_dir)
{
const auto debug_include_dir = package_dir / "debug/include";
const auto debug_include_dir = package_dir / "debug" / "include";

std::vector<Path> files_found = fs.get_regular_files_recursive(debug_include_dir, IgnoreErrors{});

Expand All @@ -221,7 +221,7 @@ namespace vcpkg::PostBuildLint

static LintStatus check_for_files_in_debug_share_directory(const Filesystem& fs, const Path& package_dir)
{
const auto debug_share = package_dir / "debug/share";
const auto debug_share = package_dir / "debug" / "share";
if (fs.exists(debug_share, IgnoreErrors{}))
{
print2(Color::warning,
Expand Down Expand Up @@ -257,7 +257,7 @@ namespace vcpkg::PostBuildLint

static LintStatus check_folder_lib_cmake(const Filesystem& fs, const Path& package_dir, const PackageSpec& spec)
{
const auto lib_cmake = package_dir / "lib/cmake";
const auto lib_cmake = package_dir / "lib" / "cmake";
if (fs.exists(lib_cmake, IgnoreErrors{}))
{
vcpkg::printf(Color::warning,
Expand All @@ -277,9 +277,9 @@ namespace vcpkg::PostBuildLint
{
std::vector<Path> dirs = {
package_dir / "cmake",
package_dir / "debug/cmake",
package_dir / "lib/cmake",
package_dir / "debug/lib/cmake",
package_dir / "debug" / "cmake",
package_dir / "lib" / "cmake",
package_dir / "debug" / "lib" / "cmake",
};

std::vector<Path> misplaced_cmake_files;
Expand Down Expand Up @@ -664,7 +664,7 @@ namespace vcpkg::PostBuildLint
if (policies.is_enabled(BuildPolicy::DLLS_IN_STATIC_LIBRARY)) return LintStatus::SUCCESS;

const auto bin = package_dir / "bin";
const auto debug_bin = package_dir / "debug/bin";
const auto debug_bin = package_dir / "debug" / "bin";

const bool bin_exists = fs.exists(bin, IgnoreErrors{});
const bool debug_bin_exists = fs.exists(debug_bin, IgnoreErrors{});
Expand Down Expand Up @@ -975,9 +975,9 @@ namespace vcpkg::PostBuildLint
error_count += check_for_exes(fs, package_dir);
error_count += check_for_exes(fs, package_dir / "debug");

const auto debug_lib_dir = package_dir / "debug/lib";
const auto debug_lib_dir = package_dir / "debug" / "lib";
const auto release_lib_dir = package_dir / "lib";
const auto debug_bin_dir = package_dir / "debug/bin";
const auto debug_bin_dir = package_dir / "debug" / "bin";
const auto release_bin_dir = package_dir / "bin";

std::vector<Path> debug_libs = fs.get_regular_files_recursive(debug_lib_dir, IgnoreErrors{});
Expand Down

0 comments on commit 1d3d3ea

Please sign in to comment.