[clang-doc] Fix failing tests on Windows
authorDiego Astiazaran <diegoaat97@gmail.com>
Mon, 29 Jul 2019 22:03:39 +0000 (22:03 +0000)
committerDiego Astiazaran <diegoaat97@gmail.com>
Mon, 29 Jul 2019 22:03:39 +0000 (22:03 +0000)
Tests on Windows were failing due to path separator differences.
Links in HTML should use posix-style paths.

Differential Revision: https://reviews.llvm.org/D65419

llvm-svn: 367264

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

index 50660ff..aa62624 100644 (file)
@@ -252,6 +252,8 @@ static std::unique_ptr<HTMLNode> genTypeReference(const Reference &Type,
   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);
 }