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

Diego Astiazarán via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 25 16:10:51 PDT 2019


DiegoAstiazaran created this revision.
DiegoAstiazaran added a reviewer: juliehockett.
DiegoAstiazaran added a project: clang-tools-extra.
juliehockett accepted this revision.
juliehockett added a comment.
This revision is now accepted and ready to land.

Make sure you update the other stylesheet patch, as well, before landing that.


Tests on Windows were failing due to path separator differences.
 '/' was being used as separator in the expected output, paths in expected output are now changed to their native form before comparing them to the actual output.


https://reviews.llvm.org/D65306

Files:
  clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp


Index: clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
===================================================================
--- clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
+++ clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
@@ -114,10 +114,15 @@
   llvm::sys::path::native("../../../path/to/F.html", PathToF);
   SmallString<16> PathToInt;
   llvm::sys::path::native("../int.html", PathToInt);
+  SmallString<16> PathToSylesheet;
+  llvm::sys::path::native("../../../clang-doc-default-stylesheet.css",
+                          PathToSylesheet);
   std::string Expected = R"raw(<!DOCTYPE html>
 <meta charset="utf-8"/>
 <title>class r</title>
-<link rel="stylesheet" href="../../../clang-doc-default-stylesheet.css"/>
+<link rel="stylesheet" href=")raw" +
+                         std::string(PathToSylesheet.str()) +
+                         R"raw("/>
 <div>
   <h1>class r</h1>
   <p>Defined at line 10 of test.cpp</p>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65306.211848.patch
Type: text/x-patch
Size: 963 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190725/5f25259e/attachment.bin>


More information about the cfe-commits mailing list