Skip to content

Commit 6aad179

Browse files
committed
test work
1 parent fd3bef1 commit 6aad179

File tree

5 files changed

+22
-73
lines changed

5 files changed

+22
-73
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ file(GLOB_RECURSE LIB_SOURCES CONFIGURE_DEPENDS
7272
)
7373

7474
file(GLOB_RECURSE TOOL_SOURCES CONFIGURE_DEPENDS
75-
source/mrdox/mrdox.cpp
75+
source/mrdox/*.h
76+
source/mrdox/*.hpp
77+
source/mrdox/*.cpp
7678
)
7779

7880
file(GLOB_RECURSE TEST_SOURCES CONFIGURE_DEPENDS

include/mrdox/mrdox.hpp

Lines changed: 0 additions & 32 deletions
This file was deleted.

source/lib/XMLGenerator.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12-
#include <mrdox/mrdox.hpp>
13-
1412
#include "Generators.h"
1513
#include "Representation.h"
1614
#include <mrdox/ClangDocContext.hpp>
17-
#include "clang/Tooling/Tooling.h"
18-
#include "llvm/ADT/StringRef.h"
19-
#include "llvm/Support/FileSystem.h"
20-
#include "llvm/Support/Path.h"
15+
#include <clang/Tooling/Tooling.h>
16+
#include <llvm/ADT/StringRef.h>
17+
#include <llvm/Support/FileSystem.h>
18+
#include <llvm/Support/Path.h>
2119

2220
//------------------------------------------------
2321
/*
@@ -520,6 +518,7 @@ Format = "xml";
520518

521519
//------------------------------------------------
522520

521+
#if 0
523522
llvm::Expected<llvm::Twine>
524523
renderXML(
525524
llvm::StringRef fileName)
@@ -533,6 +532,7 @@ renderXML(
533532

534533
return llvm::Twine();
535534
}
535+
#endif
536536

537537
//------------------------------------------------
538538

File renamed without changes.

source/tests/test_main.cpp

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include "ClangDoc.h"
1212
#include "Representation.h"
13-
#include <mrdox/mrdox.hpp>
13+
#include <mrdox/ClangDocContext.hpp>
1414
#include <clang/tooling/Tooling.h>
1515
#include <llvm/ADT/StringRef.h>
1616
#include <llvm/Support/Signals.h>
@@ -40,6 +40,13 @@ do_main(int argc, const char** argv)
4040

4141
llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
4242

43+
ClangDocContext CDCtx;
44+
if(llvm::Error err = setupContext(CDCtx, argc, argv))
45+
{
46+
llvm::errs() << "test failure: " << err << "\n";
47+
return EXIT_FAILURE;
48+
}
49+
4350
for(int i = 1; i < argc; ++i)
4451
{
4552
std::error_code ec;
@@ -110,39 +117,11 @@ do_main(int argc, const char** argv)
110117
}
111118
expectedXml = xmlResult->get()->getBuffer();
112119

113-
ClangDocContext CDCtx;
114-
115-
{
116-
#if 0
117-
auto Executor =
118-
clang::tooling::createExecutorFromCommandLineArgs(
119-
1,
120-
"tests",
121-
"cat",
122-
"overview");
123-
124-
if (!Executor)
125-
{
126-
llvm::errs() << toString(Executor.takeError()) << "\n";
127-
return 1;
128-
}
129-
clang::mrdox::ClangDocContext CDCtx = {
130-
Executor->get()->getExecutionContext(),
131-
"tests",
132-
false,
133-
".",
134-
".",
135-
".",
136-
{},
137-
{} };
138-
139-
bool success = clang::tooling::runToolOnCode(
140-
makeFrontendAction(CDCtx), cppCode, cppPath);
141-
if(! success)
142-
llvm::errs() <<
143-
"Frontend action failed\n";
144-
#endif
145-
}
120+
bool success = clang::tooling::runToolOnCode(
121+
makeFrontendAction(CDCtx), cppCode, cppPath);
122+
if(! success)
123+
llvm::errs() <<
124+
"Frontend action failed\n";
146125
}
147126

148127
return EXIT_SUCCESS;

0 commit comments

Comments
 (0)