@@ -118,8 +118,57 @@ TEST(HTMLMustacheGeneratorTest, generateDocsForInfo) {
118
118
I.Children .Functions .back ().Name = " OneFunction" ;
119
119
I.Children .Enums .emplace_back ();
120
120
121
- EXPECT_THAT_ERROR (G->generateDocForInfo (&I, Actual, CDCtx), Failed ());
121
+ unittest::TempDir RootTestDirectory (" generateDocForInfoTest" ,
122
+ /* Unique=*/ true );
123
+ CDCtx.OutDirectory = RootTestDirectory.path ();
124
+
125
+ getMustacheHtmlFiles (" ../../../../../share/clang-doc" , CDCtx);
126
+
127
+ // FIXME: This is a terrible hack, since we can't initialize the templates
128
+ // directly. We'll need to update the interfaces so that we can call
129
+ // SetupTemplateFiles() from outsize of HTMLMustacheGenerator.cpp
130
+ EXPECT_THAT_ERROR (G->generateDocs (RootTestDirectory.path (), {}, CDCtx),
131
+ Succeeded ())
132
+ << " Failed to generate docs." ;
122
133
123
- std::string Expected = R"raw( )raw" ;
124
- EXPECT_THAT (Actual.str (), Eq (Expected));
134
+ EXPECT_THAT_ERROR (G->generateDocForInfo (&I, Actual, CDCtx), Succeeded ());
135
+
136
+ std::string Expected = R"raw( <!DOCTYPE html>
137
+ <html lang="en-US">
138
+ <head>
139
+ <meta charset="utf-8"/>
140
+ <title>namespace Namespace</title>
141
+ <link rel="stylesheet" type="text/css" href="../clang-doc-mustache.css"/>
142
+ <link rel="stylesheet" type="text/css" href="../"/>
143
+ <script src="../mustache-index.js"></script>
144
+ <script src="../"></script>
145
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
146
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
147
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/cpp.min.js"></script>
148
+ </head>
149
+ <body>
150
+ <nav class="navbar">
151
+ Navbar
152
+ </nav>
153
+ <main>
154
+ <div class="container">
155
+ <div class="sidebar">
156
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit,
157
+ sed do eiusmod tempor incididunt ut labore et dolore magna
158
+ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
159
+ laboris nisi ut aliquip ex ea commodo consequat.
160
+ Duis aute irure dolor in reprehenderit in voluptate velit esse
161
+ cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
162
+ cupidatat non proident, sunt in culpa qui officia deserunt mollit
163
+ anim id est laborum
164
+ </div>
165
+ <div class="resizer" id="resizer"></div>
166
+ <div class="content">
167
+ Content
168
+ </div>
169
+ </div>
170
+ </main>
171
+ </body>
172
+ </html>)raw" ;
173
+ EXPECT_EQ (Actual.str (), Expected);
125
174
}
0 commit comments