[PATCH] D142238: [clang/CodeGenActionTest] Use the platform's path separator for the `DebugInfoCWDCodeGen` test

2023-01-20 Thread Argyrios Kyrtzidis via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb2b078adc2d0: [clang/CodeGenActionTest] Use the 
platform's path separator for theā€¦ (authored by akyrtzi).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142238/new/

https://reviews.llvm.org/D142238

Files:
  clang/unittests/Frontend/CodeGenActionTest.cpp


Index: clang/unittests/Frontend/CodeGenActionTest.cpp
===
--- clang/unittests/Frontend/CodeGenActionTest.cpp
+++ clang/unittests/Frontend/CodeGenActionTest.cpp
@@ -82,9 +82,10 @@
   // Check that debug info is accessing the current working directory from the
   // VFS instead of calling \p llvm::sys::fs::current_path() directly.
 
-  auto VFS = std::make_unique();
-  VFS->setCurrentWorkingDirectory("/in-memory-fs-cwd");
   auto Sept = llvm::sys::path::get_separator();
+  auto VFS = std::make_unique();
+  VFS->setCurrentWorkingDirectory(
+  std::string(llvm::formatv("{0}in-memory-fs-cwd", Sept)));
   std::string TestPath =
   std::string(llvm::formatv("{0}in-memory-fs-cwd{0}test.cpp", Sept));
   VFS->addFile(TestPath, 0, llvm::MemoryBuffer::getMemBuffer("int x;\n"));


Index: clang/unittests/Frontend/CodeGenActionTest.cpp
===
--- clang/unittests/Frontend/CodeGenActionTest.cpp
+++ clang/unittests/Frontend/CodeGenActionTest.cpp
@@ -82,9 +82,10 @@
   // Check that debug info is accessing the current working directory from the
   // VFS instead of calling \p llvm::sys::fs::current_path() directly.
 
-  auto VFS = std::make_unique();
-  VFS->setCurrentWorkingDirectory("/in-memory-fs-cwd");
   auto Sept = llvm::sys::path::get_separator();
+  auto VFS = std::make_unique();
+  VFS->setCurrentWorkingDirectory(
+  std::string(llvm::formatv("{0}in-memory-fs-cwd", Sept)));
   std::string TestPath =
   std::string(llvm::formatv("{0}in-memory-fs-cwd{0}test.cpp", Sept));
   VFS->addFile(TestPath, 0, llvm::MemoryBuffer::getMemBuffer("int x;\n"));
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142238: [clang/CodeGenActionTest] Use the platform's path separator for the `DebugInfoCWDCodeGen` test

2023-01-20 Thread Argyrios Kyrtzidis via Phabricator via cfe-commits
akyrtzi created this revision.
Herald added a project: All.
akyrtzi requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Fixes a failure in some Windows configuration.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142238

Files:
  clang/unittests/Frontend/CodeGenActionTest.cpp


Index: clang/unittests/Frontend/CodeGenActionTest.cpp
===
--- clang/unittests/Frontend/CodeGenActionTest.cpp
+++ clang/unittests/Frontend/CodeGenActionTest.cpp
@@ -82,9 +82,10 @@
   // Check that debug info is accessing the current working directory from the
   // VFS instead of calling \p llvm::sys::fs::current_path() directly.
 
-  auto VFS = std::make_unique();
-  VFS->setCurrentWorkingDirectory("/in-memory-fs-cwd");
   auto Sept = llvm::sys::path::get_separator();
+  auto VFS = std::make_unique();
+  VFS->setCurrentWorkingDirectory(
+  std::string(llvm::formatv("{0}in-memory-fs-cwd", Sept)));
   std::string TestPath =
   std::string(llvm::formatv("{0}in-memory-fs-cwd{0}test.cpp", Sept));
   VFS->addFile(TestPath, 0, llvm::MemoryBuffer::getMemBuffer("int x;\n"));


Index: clang/unittests/Frontend/CodeGenActionTest.cpp
===
--- clang/unittests/Frontend/CodeGenActionTest.cpp
+++ clang/unittests/Frontend/CodeGenActionTest.cpp
@@ -82,9 +82,10 @@
   // Check that debug info is accessing the current working directory from the
   // VFS instead of calling \p llvm::sys::fs::current_path() directly.
 
-  auto VFS = std::make_unique();
-  VFS->setCurrentWorkingDirectory("/in-memory-fs-cwd");
   auto Sept = llvm::sys::path::get_separator();
+  auto VFS = std::make_unique();
+  VFS->setCurrentWorkingDirectory(
+  std::string(llvm::formatv("{0}in-memory-fs-cwd", Sept)));
   std::string TestPath =
   std::string(llvm::formatv("{0}in-memory-fs-cwd{0}test.cpp", Sept));
   VFS->addFile(TestPath, 0, llvm::MemoryBuffer::getMemBuffer("int x;\n"));
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits