[clang-tools-extra] r367074 - [clang-doc] Fix failing tests on Windows

Diego Astiazaran via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 25 16:22:56 PDT 2019


Author: diegoastiazaran
Date: Thu Jul 25 16:22:55 2019
New Revision: 367074

URL: http://llvm.org/viewvc/llvm-project?rev=367074&view=rev
Log:
[clang-doc] Fix failing tests on Windows

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

Modified:
    clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp

Modified: clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp?rev=367074&r1=367073&r2=367074&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp Thu Jul 25 16:22:55 2019
@@ -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>




More information about the cfe-commits mailing list