[PATCH] D65419: [clang-doc] Fix failing tests on Windows

Diego Astiazarán via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 29 14:19:58 PDT 2019


DiegoAstiazaran created this revision.
DiegoAstiazaran added a reviewer: juliehockett.
DiegoAstiazaran added a project: clang-tools-extra.

Tests on Windows were failing due to path separator differences.
Links in HTML should use posix-style paths.


https://reviews.llvm.org/D65419

Files:
  clang-tools-extra/clang-doc/HTMLGenerator.cpp


Index: clang-tools-extra/clang-doc/HTMLGenerator.cpp
===================================================================
--- clang-tools-extra/clang-doc/HTMLGenerator.cpp
+++ clang-tools-extra/clang-doc/HTMLGenerator.cpp
@@ -252,6 +252,8 @@
   llvm::SmallString<128> Path =
       computeRelativePath(Type.Path, CurrentDirectory);
   llvm::sys::path::append(Path, Type.Name + ".html");
+  // Paths in HTML must be in posix-style
+  llvm::sys::path::native(Path, llvm::sys::path::Style::posix);
   return genLink(Type.Name, Path);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65419.212225.patch
Type: text/x-patch
Size: 535 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190729/828eb13e/attachment.bin>


More information about the cfe-commits mailing list