@@ -159,8 +159,57 @@ TEST(HTMLMustacheGeneratorTest, generateDocsForInfo) {
159
159
I.Children .Functions .back ().Name = " OneFunction" ;
160
160
I.Children .Enums .emplace_back ();
161
161
162
- EXPECT_THAT_ERROR (G->generateDocForInfo (&I, Actual, CDCtx), Failed ());
162
+ unittest::TempDir RootTestDirectory (" generateDocForInfoTest" ,
163
+ /* Unique=*/ true );
164
+ CDCtx.OutDirectory = RootTestDirectory.path ();
165
+
166
+ getMustacheHtmlFiles (" ../../../../../share/clang-doc" , CDCtx);
167
+
168
+ // FIXME: This is a terrible hack, since we can't initialize the templates
169
+ // directly. We'll need to update the interfaces so that we can call
170
+ // SetupTemplateFiles() from outsize of HTMLMustacheGenerator.cpp
171
+ EXPECT_THAT_ERROR (G->generateDocs (RootTestDirectory.path (), {}, CDCtx),
172
+ Succeeded ())
173
+ << " Failed to generate docs." ;
163
174
164
- std::string Expected = R"raw( )raw" ;
165
- EXPECT_THAT (Actual.str (), Eq (Expected));
175
+ EXPECT_THAT_ERROR (G->generateDocForInfo (&I, Actual, CDCtx), Succeeded ());
176
+
177
+ std::string Expected = R"raw( <!DOCTYPE html>
178
+ <html lang="en-US">
179
+ <head>
180
+ <meta charset="utf-8"/>
181
+ <title>namespace Namespace</title>
182
+ <link rel="stylesheet" type="text/css" href="../clang-doc-mustache.css"/>
183
+ <link rel="stylesheet" type="text/css" href="../"/>
184
+ <script src="../mustache-index.js"></script>
185
+ <script src="../"></script>
186
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
187
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
188
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/cpp.min.js"></script>
189
+ </head>
190
+ <body>
191
+ <nav class="navbar">
192
+ Navbar
193
+ </nav>
194
+ <main>
195
+ <div class="container">
196
+ <div class="sidebar">
197
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit,
198
+ sed do eiusmod tempor incididunt ut labore et dolore magna
199
+ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
200
+ laboris nisi ut aliquip ex ea commodo consequat.
201
+ Duis aute irure dolor in reprehenderit in voluptate velit esse
202
+ cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
203
+ cupidatat non proident, sunt in culpa qui officia deserunt mollit
204
+ anim id est laborum
205
+ </div>
206
+ <div class="resizer" id="resizer"></div>
207
+ <div class="content">
208
+ Content
209
+ </div>
210
+ </div>
211
+ </main>
212
+ </body>
213
+ </html>)raw" ;
214
+ EXPECT_EQ (Actual.str (), Expected);
166
215
}
0 commit comments