[clang-doc] Fix failing tests on Windows
authorDiego Astiazaran <diegoaat97@gmail.com>
Thu, 25 Jul 2019 23:22:55 +0000 (23:22 +0000)
committerDiego Astiazaran <diegoaat97@gmail.com>
Thu, 25 Jul 2019 23:22:55 +0000 (23:22 +0000)
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.

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

llvm-svn: 367074

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

index 445a2ef..81fcdb1 100644 (file)
@@ -114,10 +114,15 @@ TEST(HTMLGeneratorTest, emitRecordHTML) {
   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>