Skip to content

Commit 24570e8

Browse files
committed
test: default source-root is subdir
1 parent aea4acf commit 24570e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+204
-214
lines changed

src/test/TestRunner.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,10 @@ handleDir(
277277
entry.type() == fs::file_type::directory_file)
278278
{
279279
// Check for a subdirectory-wide config
280+
auto const& subdir = entry.path();
280281
Config::Settings subdirSettings = dirSettings;
281-
std::string const& configPath = files::appendPath(entry.path(), "mrdocs.yml");
282+
subdirSettings.sourceRoot = subdir;
283+
std::string const& configPath = files::appendPath(subdir, "mrdocs.yml");
282284
if (files::exists(configPath))
283285
{
284286
if (auto exp = Config::Settings::load_file(subdirSettings, configPath, dirs_); !exp)
@@ -290,7 +292,7 @@ handleDir(
290292
return report::error("Failed to normalize config file: {}: \"{}\"", exp.error(), configPath);
291293
}
292294
}
293-
handleDir(entry.path(), subdirSettings);
295+
handleDir(subdir, subdirSettings);
294296
}
295297
else if(
296298
entry.type() == fs::file_type::regular_file &&
@@ -337,9 +339,9 @@ checkPath(
337339
Config::Settings dirSettings;
338340
testArgs.apply(dirSettings, dirs_, argv);
339341
dirSettings.multipage = false;
340-
dirSettings.sourceRoot = files::appendPath(inputPath, ".");
341-
342+
dirSettings.sourceRoot = inputDir;
342343
std::string const& configPath = files::appendPath(inputDir, "mrdocs.yml");
344+
343345
if (files::exists(configPath))
344346
{
345347
if (auto exp = Config::Settings::load_file(dirSettings, configPath, dirs_); !exp)

test-files/golden-tests/core/mrdocs.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-files/golden-tests/filters/file/mrdocs.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-files/golden-tests/filters/symbol-name/mrdocs.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-files/golden-tests/filters/symbol-type/mrdocs.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-files/golden-tests/javadoc/mrdocs.yml

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

test-files/golden-tests/output/mrdocs.yml

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

test-files/golden-tests/templates/c_mct_expl_inline.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
=== Synopsis
2222

2323

24-
Declared in `<templates/c_mct_expl_inline.cpp>`
24+
Declared in `<c_mct_expl_inline.cpp>`
2525

2626
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
2727
----
@@ -47,7 +47,7 @@ struct A;
4747
=== Synopsis
4848

4949

50-
Declared in `<templates/c_mct_expl_inline.cpp>`
50+
Declared in `<c_mct_expl_inline.cpp>`
5151

5252
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
5353
----
@@ -73,7 +73,7 @@ struct B;
7373
=== Synopsis
7474

7575

76-
Declared in `<templates/c_mct_expl_inline.cpp>`
76+
Declared in `<c_mct_expl_inline.cpp>`
7777

7878
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
7979
----
@@ -88,7 +88,7 @@ f();
8888
=== Synopsis
8989

9090

91-
Declared in `<templates/c_mct_expl_inline.cpp>`
91+
Declared in `<c_mct_expl_inline.cpp>`
9292

9393
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
9494
----
@@ -114,7 +114,7 @@ struct <<A-B-04,B>>&lt;int&gt;;
114114
=== Synopsis
115115

116116

117-
Declared in `&lt;templates&sol;c&lowbar;mct&lowbar;expl&lowbar;inline&period;cpp&gt;`
117+
Declared in `&lt;c&lowbar;mct&lowbar;expl&lowbar;inline&period;cpp&gt;`
118118

119119
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
120120
----

test-files/golden-tests/templates/c_mct_expl_inline.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h2 id="A">A</h2>
2929
<div>
3030
<h3>Synopsis</h3>
3131
<div>
32-
Declared in <code>&lt;templates/c_mct_expl_inline.cpp&gt;</code></div>
32+
Declared in <code>&lt;c_mct_expl_inline.cpp&gt;</code></div>
3333
<pre>
3434
<code class="source-code cpp">
3535
struct A;
@@ -59,7 +59,7 @@ <h2 id="A-B-04"><a href="#A">A</a>::B</h2>
5959
<div>
6060
<h3>Synopsis</h3>
6161
<div>
62-
Declared in <code>&lt;templates/c_mct_expl_inline.cpp&gt;</code></div>
62+
Declared in <code>&lt;c_mct_expl_inline.cpp&gt;</code></div>
6363
<pre>
6464
<code class="source-code cpp">
6565
template&lt;typename T&gt;
@@ -89,7 +89,7 @@ <h2 id="A-B-04-f"><a href="#A">A</a>::<a href="#A-B-04">B</a>::f</h2>
8989
<div>
9090
<h3>Synopsis</h3>
9191
<div>
92-
Declared in <code>&lt;templates/c_mct_expl_inline.cpp&gt;</code></div>
92+
Declared in <code>&lt;c_mct_expl_inline.cpp&gt;</code></div>
9393
<pre>
9494
<code class="source-code cpp">
9595
void
@@ -105,7 +105,7 @@ <h2 id="A-B-01"><a href="#A">A</a>::B&lt;int&gt;</h2>
105105
<div>
106106
<h3>Synopsis</h3>
107107
<div>
108-
Declared in <code>&lt;templates/c_mct_expl_inline.cpp&gt;</code></div>
108+
Declared in <code>&lt;c_mct_expl_inline.cpp&gt;</code></div>
109109
<pre>
110110
<code class="source-code cpp">
111111
template&lt;&gt;
@@ -135,7 +135,7 @@ <h2 id="A-B-01-g"><a href="#A">A</a>::<a href="#A-B-01">B</a>&lt;int&gt;::g</h2>
135135
<div>
136136
<h3>Synopsis</h3>
137137
<div>
138-
Declared in <code>&lt;templates/c_mct_expl_inline.cpp&gt;</code></div>
138+
Declared in <code>&lt;c_mct_expl_inline.cpp&gt;</code></div>
139139
<pre>
140140
<code class="source-code cpp">
141141
void

test-files/golden-tests/templates/c_mct_expl_inline.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
xsi:noNamespaceSchemaLocation="https://github.com/cppalliance/mrdocs/raw/develop/mrdocs.rnc">
44
<namespace id="//////////////////////////8=">
55
<struct name="A" id="YrPSaKAbmXgzCAX5WByx4eVoqBM=">
6-
<file short-path="templates/c_mct_expl_inline.cpp" source-path="templates/c_mct_expl_inline.cpp" line="1" class="def"/>
6+
<file short-path="c_mct_expl_inline.cpp" source-path="c_mct_expl_inline.cpp" line="1" class="def"/>
77
<template>
88
<tparam name="T" class="type"/>
99
<struct name="B" id="TqGFMDXDQ6ddt946aVDeyhY9Ij8=">
10-
<file short-path="templates/c_mct_expl_inline.cpp" source-path="templates/c_mct_expl_inline.cpp" line="3" class="def"/>
10+
<file short-path="c_mct_expl_inline.cpp" source-path="c_mct_expl_inline.cpp" line="3" class="def"/>
1111
<function name="f" id="GOVvMTuIkLp/PqUkD5z7Bvf4+FQ=">
12-
<file short-path="templates/c_mct_expl_inline.cpp" source-path="templates/c_mct_expl_inline.cpp" line="4" class="def"/>
12+
<file short-path="c_mct_expl_inline.cpp" source-path="c_mct_expl_inline.cpp" line="4" class="def"/>
1313
</function>
1414
</struct>
1515
</template>
1616
<template class="explicit" id="TqGFMDXDQ6ddt946aVDeyhY9Ij8=">
1717
<targ class="type" type="int"/>
1818
<struct name="B" id="FxMFFVpoV2/LOOndnkQ2gu3w69U=">
19-
<file short-path="templates/c_mct_expl_inline.cpp" source-path="templates/c_mct_expl_inline.cpp" line="7" class="def"/>
19+
<file short-path="c_mct_expl_inline.cpp" source-path="c_mct_expl_inline.cpp" line="7" class="def"/>
2020
<function name="g" id="nxkAf/oNulEWX8A/IPUHkew79Y4=">
21-
<file short-path="templates/c_mct_expl_inline.cpp" source-path="templates/c_mct_expl_inline.cpp" line="7" class="def"/>
21+
<file short-path="c_mct_expl_inline.cpp" source-path="c_mct_expl_inline.cpp" line="7" class="def"/>
2222
</function>
2323
</struct>
2424
</template>

0 commit comments

Comments
 (0)