File tree 3 files changed +19
-13
lines changed
3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -570,9 +570,7 @@ renderCodeAsXML(
570
570
Corpus corpus;
571
571
if (llvm::Error err = buildIndex (cfg, corpus))
572
572
return ! err;
573
- XMLGenerator (cfg).render (xml, corpus, cfg);
574
-
575
- return true ;
573
+ return XMLGenerator (cfg).render (xml, corpus, cfg);
576
574
}
577
575
578
576
// ------------------------------------------------
Original file line number Diff line number Diff line change 12
12
#include " Mapper.h"
13
13
#include " Representation.h"
14
14
#include < mrdox/Config.hpp>
15
+ #include < mrdox/XML.hpp>
15
16
#include < clang/tooling/Tooling.h>
16
17
#include < llvm/ADT/StringRef.h>
17
18
#include < llvm/Support/Signals.h>
@@ -58,6 +59,7 @@ do_main(int argc, const char** argv)
58
59
return EXIT_FAILURE;
59
60
}
60
61
62
+ std::string xml;
61
63
for (int i = 1 ; i < argc; ++i)
62
64
{
63
65
std::error_code ec;
@@ -128,17 +130,12 @@ do_main(int argc, const char** argv)
128
130
}
129
131
expectedXml = xmlResult->get ()->getBuffer ();
130
132
131
- std::unique_ptr<ASTUnit> astUnit =
132
- clang::tooling::buildASTFromCodeWithArgs (cppCode, {});
133
- MapASTVisitor visitor (cfg);
134
- visitor.HandleTranslationUnit (astUnit->getASTContext ());
135
- Corpus corpus;
136
- if (llvm::Error err = buildIndex (cfg, corpus))
137
- {
138
- llvm::errs () <<
139
- toString (std::move (err)) << " \n " ;
133
+ if (! renderCodeAsXML (xml, cppCode, cfg))
140
134
return EXIT_FAILURE;
141
- }
135
+
136
+ if (xml != expectedXml)
137
+ llvm::errs () <<
138
+ " Failed: \" " << xmlPath << " \"\n " ;
142
139
}
143
140
144
141
return EXIT_SUCCESS;
Original file line number Diff line number Diff line change
1
+ <ns n =" " >
2
+ <fn n =" f1" r =" void" a =" 3" >
3
+ <tp n =" class T" />
4
+ </fn >
5
+ <fn n =" f2" r =" void" a =" 3" >
6
+ <tp n =" typename U" />
7
+ </fn >
8
+ <fn n =" f3" r =" void" a =" 3" >
9
+ <tp n =" int N" />
10
+ </fn >
11
+ </ns >
You can’t perform that action at this time.
0 commit comments