All Tests¶
The tests
package contains all of the test classes / functions.
Exhale Core Tests¶
configs
¶
Tests for validating error handling with configs set in conf.py
.
-
testing.tests.configs.
assert_message_not_present
(test, message, text, flags=0)[source]¶ Assert that
message
is found intext
.This method is useful for creating consistent error messages when a test fails, including printing out what the contents of
message
andtext
were.Parameters
test
(ExhaleTestCase
)The test case to call
assertTrue
with, should just beself
for most test cases in the framework.message
(str
)The message to search for in
text
. This will be thepattern
parameter for a call tore.search()
.text
(str
)The text to be searched. This will be the
string
parameter for a call tore.search()
.flags
(int
)Optional flags to supply as
flags
tore.search()
. Default of0
means no special flags sent.
-
testing.tests.configs.
assert_message_present
(test, message, text, flags=0)[source]¶ Assert that
message
is not found intext
.This method is useful for creating consistent error messages when a test fails, including printing out what the contents of
message
andtext
were.Parameters
test
(ExhaleTestCase
)The test case to call
assertTrue
with, should just beself
for most test cases in the framework.message
(str
)The message to search for in
text
. This will be thepattern
parameter for a call tore.search()
.text
(str
)The text to be searched. This will be the
string
parameter for a call tore.search()
.flags
(int
)Optional flags to supply as
flags
tore.search()
. Default of0
means no special flags sent.
-
class
testing.tests.configs.
ConfigurationStatusTests
(methodName='runTest')[source]¶ Tests to ensure expected status messages are displayed.
-
test_project
= 'cpp_nesting'¶ Test Project Source
View the cpp_nesting source code here. See also:
ExhaleTestCase.test_project
.Note
The
cpp_nesting
project is just being recycled, the tests for that project take place inCPPNesting
.
-
treeview_add_start_message
= 'Exhale: adding tree view css / javascript\\.'¶ Start message displayed only when
createTreeView
isTrue
.
-
treeview_add_close_message
= 'Exhale: added tree view css / javascript\\.'¶ Closing message displayed only when
createTreeView
isTrue
.
-
-
class
testing.tests.configs.
ConfigurationWarningTests
(methodName='runTest')[source]¶ Tests to ensure non-fatal configuration discrepancies receive warnings.
-
test_project
= 'cpp_nesting'¶ Test Project Source
View the cpp_nesting source code here. See also:
ExhaleTestCase.test_project
.Note
The
cpp_nesting
project is just being recycled, the tests for that project take place inCPPNesting
.
-
-
class
testing.tests.configs.
ListingExcludeTests
(methodName='runTest')[source]¶ Test for expected failures when invalid configurations are given in
conf.py
.-
test_project
= 'cpp_nesting'¶ Test Project Source
View the cpp_nesting source code here. See also:
ExhaleTestCase.test_project
.Note
The
cpp_nesting
project is just being recycled, the tests for that project take place inCPPNesting
.
-
class
BadStr
[source]¶ Helper for
ListingExcludeTests.test_invalid_report_index()
.
-
test_invalid_report_index
()[source]¶ Verify list index is indicated when item cannot be converted to string.
-
-
class
testing.tests.configs.
UnabridgedOrphanKindsTests
(methodName='runTest')[source]¶ Test various values of
unabridgedOrphanKinds
.-
test_project
= 'cpp_long_names'¶ Test Project Source
View the cpp_long_names source code here. See also:
ExhaleTestCase.test_project
.The
cpp_long_names
project essentially has 1 compound of each kind, which makes it an ideal project to reuse here.
-
configs_tree_view
¶
Tests specifically focused on the various tree view configurations.
-
testing.tests.configs_tree_view.
class_hierarchy_ground_truth
= {'bootstrap': '\n<div id="class-treeView"></div>\n<script type="text/javascript">\nfunction getClassHierarchyTree() {\n return [\n {\n text: "<span class=\\"text-muted\\">Namespace</span> nested",\n href: "namespace_nested.html#namespace-nested",\n selectable: false,\n tags: [\'4\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Namespace</span> nested::dual_nested",\n href: "namespace_nested__dual_nested.html#namespace-nested-dual-nested",\n selectable: false,\n tags: [\'2\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Struct</span> one",\n href: "structnested_1_1dual__nested_1_1one.html#exhale-struct-structnested-1-1dual-nested-1-1one",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Struct</span> one::params",\n href: "structnested_1_1dual__nested_1_1one_1_1params.html#exhale-struct-structnested-1-1dual-nested-1-1one-1-1params",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Union</span> params::four_bytes",\n href: "unionnested_1_1dual__nested_1_1one_1_1params_1_1four__bytes.html#exhale-union-unionnested-1-1dual-nested-1-1one-1-1params-1-1four-bytes",\n selectable: false,\n },\n ]\n },\n ]\n },\n {\n text: "<span class=\\"text-muted\\">Struct</span> two",\n href: "structnested_1_1dual__nested_1_1two.html#exhale-struct-structnested-1-1dual-nested-1-1two",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Struct</span> two::params",\n href: "structnested_1_1dual__nested_1_1two_1_1params.html#exhale-struct-structnested-1-1dual-nested-1-1two-1-1params",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Union</span> params::four_bytes",\n href: "unionnested_1_1dual__nested_1_1two_1_1params_1_1four__bytes.html#exhale-union-unionnested-1-1dual-nested-1-1two-1-1params-1-1four-bytes",\n selectable: false,\n },\n ]\n },\n ]\n },\n ]\n },\n {\n text: "<span class=\\"text-muted\\">Struct</span> one",\n href: "structnested_1_1one.html#exhale-struct-structnested-1-1one",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Struct</span> one::params",\n href: "structnested_1_1one_1_1params.html#exhale-struct-structnested-1-1one-1-1params",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Union</span> params::four_bytes",\n href: "unionnested_1_1one_1_1params_1_1four__bytes.html#exhale-union-unionnested-1-1one-1-1params-1-1four-bytes",\n selectable: false,\n },\n ]\n },\n ]\n },\n {\n text: "<span class=\\"text-muted\\">Struct</span> two",\n href: "structnested_1_1two.html#exhale-struct-structnested-1-1two",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Struct</span> two::params",\n href: "structnested_1_1two_1_1params.html#exhale-struct-structnested-1-1two-1-1params",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Union</span> params::four_bytes",\n href: "unionnested_1_1two_1_1params_1_1four__bytes.html#exhale-union-unionnested-1-1two-1-1params-1-1four-bytes",\n selectable: false,\n },\n ]\n },\n ]\n },\n {\n text: "<span class=\\"text-muted\\">Union</span> four_bytes",\n href: "unionnested_1_1four__bytes.html#exhale-union-unionnested-1-1four-bytes",\n selectable: false,\n },\n ]\n },\n {\n text: "<span class=\\"text-muted\\">Struct</span> top_level",\n href: "structtop__level.html#exhale-struct-structtop-level",\n selectable: false,\n },\n\n ]\n}\n</script><!-- end getClassHierarchyTree() function -->\n', 'collapsible_lists': '\n<ul class="treeView" id="class-treeView">\n<li>\n <ul class="collapsibleList">\n <li>\n Namespace <a href="namespace_nested.html#namespace-nested">nested</a>\n <ul>\n <li>\n Namespace <a href="namespace_nested__dual_nested.html#namespace-nested-dual-nested">nested::dual_nested</a>\n <ul>\n <li>\n Struct <a href="structnested_1_1dual__nested_1_1one.html#exhale-struct-structnested-1-1dual-nested-1-1one">one</a>\n <ul>\n <li class="lastChild">\n Struct <a href="structnested_1_1dual__nested_1_1one_1_1params.html#exhale-struct-structnested-1-1dual-nested-1-1one-1-1params">one::params</a>\n <ul>\n <li class="lastChild">Union <a href="unionnested_1_1dual__nested_1_1one_1_1params_1_1four__bytes.html#exhale-union-unionnested-1-1dual-nested-1-1one-1-1params-1-1four-bytes">params::four_bytes</a></li>\n </ul>\n </li>\n </ul>\n </li>\n <li class="lastChild">\n Struct <a href="structnested_1_1dual__nested_1_1two.html#exhale-struct-structnested-1-1dual-nested-1-1two">two</a>\n <ul>\n <li class="lastChild">\n Struct <a href="structnested_1_1dual__nested_1_1two_1_1params.html#exhale-struct-structnested-1-1dual-nested-1-1two-1-1params">two::params</a>\n <ul>\n <li class="lastChild">Union <a href="unionnested_1_1dual__nested_1_1two_1_1params_1_1four__bytes.html#exhale-union-unionnested-1-1dual-nested-1-1two-1-1params-1-1four-bytes">params::four_bytes</a></li>\n </ul>\n </li>\n </ul>\n </li>\n </ul>\n </li>\n <li>\n Struct <a href="structnested_1_1one.html#exhale-struct-structnested-1-1one">one</a>\n <ul>\n <li class="lastChild">\n Struct <a href="structnested_1_1one_1_1params.html#exhale-struct-structnested-1-1one-1-1params">one::params</a>\n <ul>\n <li class="lastChild">Union <a href="unionnested_1_1one_1_1params_1_1four__bytes.html#exhale-union-unionnested-1-1one-1-1params-1-1four-bytes">params::four_bytes</a></li>\n </ul>\n </li>\n </ul>\n </li>\n <li>\n Struct <a href="structnested_1_1two.html#exhale-struct-structnested-1-1two">two</a>\n <ul>\n <li class="lastChild">\n Struct <a href="structnested_1_1two_1_1params.html#exhale-struct-structnested-1-1two-1-1params">two::params</a>\n <ul>\n <li class="lastChild">Union <a href="unionnested_1_1two_1_1params_1_1four__bytes.html#exhale-union-unionnested-1-1two-1-1params-1-1four-bytes">params::four_bytes</a></li>\n </ul>\n </li>\n </ul>\n </li>\n <li class="lastChild">Union <a href="unionnested_1_1four__bytes.html#exhale-union-unionnested-1-1four-bytes">four_bytes</a></li>\n </ul>\n </li>\n <li class="lastChild">Struct <a href="structtop__level.html#exhale-struct-structtop-level">top_level</a></li>\n\n </ul>\n</li><!-- only tree view element -->\n</ul><!-- /treeView class-treeView -->\n', 'default_rst_list': '\n- :ref:`namespace_nested`\n - :ref:`namespace_nested__dual_nested`\n - :ref:`exhale_struct_structnested_1_1dual__nested_1_1one`\n - :ref:`exhale_struct_structnested_1_1dual__nested_1_1one_1_1params`\n - :ref:`exhale_union_unionnested_1_1dual__nested_1_1one_1_1params_1_1four__bytes`\n - :ref:`exhale_struct_structnested_1_1dual__nested_1_1two`\n - :ref:`exhale_struct_structnested_1_1dual__nested_1_1two_1_1params`\n - :ref:`exhale_union_unionnested_1_1dual__nested_1_1two_1_1params_1_1four__bytes`\n - :ref:`exhale_struct_structnested_1_1one`\n - :ref:`exhale_struct_structnested_1_1one_1_1params`\n - :ref:`exhale_union_unionnested_1_1one_1_1params_1_1four__bytes`\n - :ref:`exhale_struct_structnested_1_1two`\n - :ref:`exhale_struct_structnested_1_1two_1_1params`\n - :ref:`exhale_union_unionnested_1_1two_1_1params_1_1four__bytes`\n - :ref:`exhale_union_unionnested_1_1four__bytes`\n- :ref:`exhale_struct_structtop__level`\n'}¶ Ground truth for the three versions of class hierarchies.
Keys and what they represent:
"default_rst_list"
The reStructuredText list version (
createTreeView=False
)."collapsible_lists"
The collapsible lists version of the tree view (raw html unordered list).
"bootstrap"
The bootstrap version of the tree view (raw JavaScript function returning json data).
Todo
This will break if / when doxygen refid generation changes. In theory it should be possible to synthetically re-create the hierarchy without this crazy text processing.
-
testing.tests.configs_tree_view.
file_hierarchy_ground_truth
= {'bootstrap': '\n<div id="file-treeView"></div>\n<script type="text/javascript">\nfunction getFileHierarchyTree() {\n return [\n {\n text: "<span class=\\"text-muted\\">Directory</span> include",\n href: "dir_include.html#dir-include",\n selectable: false,\n tags: [\'2\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Directory</span> nested",\n href: "dir_include_nested.html#dir-include-nested",\n selectable: false,\n tags: [\'3\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Directory</span> nested",\n href: "dir_include_nested_dual_nested.html#dir-include-nested-dual-nested",\n selectable: false,\n tags: [\'2\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">Directory</span> one",\n href: "dir_include_nested_dual_nested_one.html#dir-include-nested-dual-nested-one",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">File</span> one.hpp",\n href: "file_include_nested_dual_nested_one_one.hpp.html#file-include-nested-dual-nested-one-one.hpp",\n selectable: false,\n },\n ]\n },\n {\n text: "<span class=\\"text-muted\\">Directory</span> two",\n href: "dir_include_nested_dual_nested_two.html#dir-include-nested-dual-nested-two",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">File</span> two.hpp",\n href: "file_include_nested_dual_nested_two_two.hpp.html#file-include-nested-dual-nested-two-two.hpp",\n selectable: false,\n },\n ]\n },\n ]\n },\n {\n text: "<span class=\\"text-muted\\">Directory</span> one",\n href: "dir_include_nested_one.html#dir-include-nested-one",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">File</span> one.hpp",\n href: "file_include_nested_one_one.hpp.html#file-include-nested-one-one.hpp",\n selectable: false,\n },\n ]\n },\n {\n text: "<span class=\\"text-muted\\">Directory</span> two",\n href: "dir_include_nested_two.html#dir-include-nested-two",\n selectable: false,\n tags: [\'1\'],\n\n nodes: [\n {\n text: "<span class=\\"text-muted\\">File</span> two.hpp",\n href: "file_include_nested_two_two.hpp.html#file-include-nested-two-two.hpp",\n selectable: false,\n },\n ]\n },\n ]\n },\n {\n text: "<span class=\\"text-muted\\">File</span> top_level.hpp",\n href: "file_include_top_level.hpp.html#file-include-top-level.hpp",\n selectable: false,\n },\n ]\n },\n\n ]\n}\n</script><!-- end getFileHierarchyTree() function -->\n', 'collapsible_lists': '\n<ul class="treeView" id="file-treeView">\n<li>\n <ul class="collapsibleList">\n <li class="lastChild">\n Directory <a href="dir_include.html#dir-include">include</a>\n <ul>\n <li>\n Directory <a href="dir_include_nested.html#dir-include-nested">nested</a>\n <ul>\n <li>\n Directory <a href="dir_include_nested_dual_nested.html#dir-include-nested-dual-nested">nested</a>\n <ul>\n <li>\n Directory <a href="dir_include_nested_dual_nested_one.html#dir-include-nested-dual-nested-one">one</a>\n <ul>\n <li class="lastChild">File <a href="file_include_nested_dual_nested_one_one.hpp.html#file-include-nested-dual-nested-one-one.hpp">one.hpp</a></li>\n </ul>\n </li>\n <li class="lastChild">\n Directory <a href="dir_include_nested_dual_nested_two.html#dir-include-nested-dual-nested-two">two</a>\n <ul>\n <li class="lastChild">File <a href="file_include_nested_dual_nested_two_two.hpp.html#file-include-nested-dual-nested-two-two.hpp">two.hpp</a></li>\n </ul>\n </li>\n </ul>\n </li>\n <li>\n Directory <a href="dir_include_nested_one.html#dir-include-nested-one">one</a>\n <ul>\n <li class="lastChild">File <a href="file_include_nested_one_one.hpp.html#file-include-nested-one-one.hpp">one.hpp</a></li>\n </ul>\n </li>\n <li class="lastChild">\n Directory <a href="dir_include_nested_two.html#dir-include-nested-two">two</a>\n <ul>\n <li class="lastChild">File <a href="file_include_nested_two_two.hpp.html#file-include-nested-two-two.hpp">two.hpp</a></li>\n </ul>\n </li>\n </ul>\n </li>\n <li class="lastChild">File <a href="file_include_top_level.hpp.html#file-include-top-level.hpp">top_level.hpp</a></li>\n </ul>\n </li>\n\n </ul>\n</li><!-- only tree view element -->\n</ul><!-- /treeView file-treeView -->\n', 'default_rst_list': '\n- :ref:`dir_include`\n - :ref:`dir_include_nested`\n - :ref:`dir_include_nested_dual_nested`\n - :ref:`dir_include_nested_dual_nested_one`\n - :ref:`file_include_nested_dual_nested_one_one.hpp`\n - :ref:`dir_include_nested_dual_nested_two`\n - :ref:`file_include_nested_dual_nested_two_two.hpp`\n - :ref:`dir_include_nested_one`\n - :ref:`file_include_nested_one_one.hpp`\n - :ref:`dir_include_nested_two`\n - :ref:`file_include_nested_two_two.hpp`\n - :ref:`file_include_top_level.hpp`\n'}¶ Ground truth for the three versions of file hierarchies.
Keys and what they represent:
"default_rst_list"
The reStructuredText list version (
createTreeView=False
)."collapsible_lists"
The collapsible lists version of the tree view (raw html unordered list).
"bootstrap"
The bootstrap version of the tree view (raw JavaScript function returning json data).
Todo
This one should be possible to re-create manually rather than relying on direct text comparisons. But until you figure out how to do the class one more programmatically you aren’t doing that lolz.
-
class
testing.tests.configs_tree_view.
TreeViewHierarchyTests
(methodName='runTest')[source]¶ Naive tests on raw “reStructuredText” generated for tree views.
-
test_project
= 'cpp_nesting'¶ Test Project Source
View the cpp_nesting source code here. See also:
ExhaleTestCase.test_project
.Note
The
cpp_nesting
project is just being recycled, the tests for that project take place inCPPNesting
.
-
html_hierarchies
()[source]¶ Hierarchy text from
class_view_hierarchy.rst
andfile_view_hierarchy.rst
.When
createTreeView=True
, the generated page has something like:Class View Hierarchy -------------------- .. raw:: html <ul> <li> ... </li> <!-- ... --> <li> ... </li> </ul> .. end raw html for treeView
What this method does is simply search for
.. raw:: html
and.. end
respectively, accumulating everything in between. Since we are performing direct string comparisons with “ground truth” values, we specifically accumulateline.strip()
to remove the leading indentation since it is under a.. raw:: html
directive. Finally, the returned output is filtered usingfilter_empty_lines()
.
-
line_compare
(expected_list, test_list)[source]¶ Compare two lists of strings.
Performs two tests:
That
len(expected_list)
andlen(test_list)
are the same.That the order and values of strings in
expected_list
are the same astest_list
. Mismatched values will be printed in the assertion.
-
line_compare_minified
(expected_list, test_list, bootstrap=False)[source]¶ Compare two lists of tree view strings.
This responsible expects the same input as
line_compare()
, but does some additional processing on theexpected_list
. To explain, let’s take a look at the lines involved in the actual minified output:Index
Collapsible Lists (HTML Unordered List)
Bootstrap Version (JavaScript Function Returning JSON)
0
<ul class="treeView" id="class-treeView">
<script type="text/javascript">
1
<li>
function getClassHierarchyTree() {
2
<ul class="collapsibleList">
return [
3
<<< really long >>>
<<< really long >>>
4
</ul>
]
5
</li><!-- only tree view element -->
}
6
</ul><!-- /treeView class-treeView -->
</script><!-- end getClassHierarchyTree() function --></div>
By convenience and design, line
3
is really the thing we want to test, because that is the meat of the tree view. For completeness indices[0,3)
and[4,6]
are also validated, but constructing line3
from the providedexpected_list
(the non-minified ground truth) is the focus of this test function.
-
html_ground_truth_list
(hierarchy, key)[source]¶ Ground truth data for html-based validation tests.
- Parameters
hierarchy
(str
)Should only be
"class"
or"file"
. Indexes intoclass_hierarchy_ground_truth
andfile_hierarchy_ground_truth
respectively.key
(str
)The key to lookup in either
class_hierarchy_ground_truth
orfile_hierarchy_ground_truth
. Specifically, you really only want to be using"collapsible_lists"
or"bootstrap"
, since the raw reStructuredText version (createTreeView=False
) can be compared directly.
- Return (
list
ofstr
) The text specified by
hierarchy[key]
, with every line split and lines filtered byfilter_empty_lines()
.
-
test_collapsible_lists
()[source]¶ Verify the un-minified collapsible lists html unordered list appears as expected.
-
Project Tests¶
c_maths
¶
Tests for the c_maths
project.
-
class
testing.tests.c_maths.
CMathsTests
(methodName='runTest')[source]¶ Primary test class for project
c_maths
.-
test_project
= 'c_maths'¶ Test Project Source
View the c_maths source code here. See also:
ExhaleTestCase.test_project
.
-
-
class
testing.tests.c_maths.
CMathsTestsNoRun
(methodName='runTest')[source]¶ Secondary test case for project
c_maths
.A
testing.decorators.no_run()
decorated test class.-
test_project
= 'c_maths'¶ Test Project Source
View the c_maths source code here. See also:
ExhaleTestCase.test_project
.
-
cpp_fortran_mixed
¶
Tests for the cpp_fortran_mixed
project.
-
class
testing.tests.cpp_fortran_mixed.
CPPFortranMixed
(methodName='runTest')[source]¶ Primary test class for project
cpp_fortran_mixed
.This test class exists to test explicit language lexer mappings via
lexerMapping
. Note that the C++ code and namespaceconvert
is definitively chosen to be different than the name of the fortran module name (conversions
). If they are the same, some interesting things happen on the Doxygen side, because Doxygen will combine the namespaces.Todo
These tests are incomplete (
from __future__ import config_objects
). The module level storage creates conflicts between the test cases when specifying the regular expressions :/Currently there is only one test for a custom lexer mapping, and it only actually works because the name is alphabetically sorted after the default test (meaning pytest will run it after).
Todo
The full function validation does not support templates (yet). Templates at large in the testing framework need to be reworked, currently it is all boiler plate code with no actual validation…
-
test_project
= 'cpp_fortran_mixed'¶ Test Project Source
View the cpp_fortran_mixed source code here. See also:
ExhaleTestCase.test_project
.
-
file_hierarchy_dict
= {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.file object>: {<testing.hierarchies.namespace object>: {<testing.hierarchies.function object>: <testing.hierarchies.parameters object>, <testing.hierarchies.function object>: <testing.hierarchies.parameters object>}}}}, <testing.hierarchies.directory object>: {<testing.hierarchies.file object>: {<testing.hierarchies.namespace object>: {<testing.hierarchies.function object>: <testing.hierarchies.parameters object>, <testing.hierarchies.function object>: <testing.hierarchies.parameters object>, <testing.hierarchies.function object>: <testing.hierarchies.parameters object>, <testing.hierarchies.function object>: <testing.hierarchies.parameters object>, <testing.hierarchies.variable object>: {}, <testing.hierarchies.variable object>: {}, <testing.hierarchies.variable object>: {}, <testing.hierarchies.variable object>: {}}}}}¶ The file hierarchy for this project.
-
test_hierarchies
()[source]¶ Validate the class and file hierarchies.
Not tested on Windows, maybe I’ll care to fix it one day. But it is not this day!
Todo
Too much shared code in hierarchy comparisons, the class hierarchy for this project should be empty. Need to enable asserting this fact (same for the
cpp_nesting
project).
-
validate_pygments_lexers
(exhale_root, node_map)[source]¶ Validate nodes have the expected pygments lexer in their program listing file.
Parameters
exhale_root
(exhale.graph.ExhaleRoot
)The graph root object for this project.
node_map
(dict
)A map of
exhale.graph.ExhaleNode
objects to string values. The keys must be the nodes extracted from theexhale_root
(as opposed to a testing type). Each value should be a pygments lexer, such as"cpp"
or"fortran"
.The generated program listing file will be parsed and an assert statement performed for equality to these specified values.
-
get_hpp_and_f90_nodes
(exhale_root)[source]¶ Return the two
ExhaleNode
objects for this project.Parameters
exhale_root
(ExhaleRoot
)The graph root object for this project.
Returns
tuple
A length two tuple of
ExhaleNode
objects, ordered as(convert_hpp, conversions_f90)
. These represent the filesinclude/convert/convert.hpp
andsrc/conversions.f90
, respectively.
-
cpp_long_names
¶
Tests for the cpp_long_names
project.
-
testing.tests.cpp_long_names.
RUN_ABSURD_TEST
= True¶ When
platform.system() != "Windows"
,ABSURD_DIRECTORY_PATH
is created.
-
testing.tests.cpp_long_names.
make_it_big
(prefix)[source]¶ Mirrors the macro
MAKE_IT_BIG
inabsurdly_long_names.hpp
.
-
testing.tests.cpp_long_names.
ABSURD_DIRECTORY_PATH
= '/home/docs/checkouts/readthedocs.org/user_builds/exhale/checkouts/1.x/testing/projects/cpp_long_names/include/directory/structure/that/is/longer/than/two/hundred/and/fifty/five/characters/long/which/is/an/absolutely/and/completely/ridiculous/thing/to/do/and/if/you/did/this/in/the/real/world/you/put/yourself/comfortably/in/a/position/to/be/downsized/and/outta/here/as/soul/position/would/explain/to/you'¶ The absurd directory path that will be created depending on
RUN_ABSURD_TEST
.
-
testing.tests.cpp_long_names.
make_file_hierarchy_dict
()[source]¶ Return the
dict
representing the file hierarchy.If
RUN_ABSURD_TEST
isTrue
,ABSURD_DIRECTORY_PATH
will be incorporated in the returned dictionary.
-
testing.tests.cpp_long_names.
create_absurd_directory_structure
()[source]¶ Create the absurd directory structure when
RUN_ABSURD_TEST
isTrue
.Helper function for the testing fixture
potentially_with_insanity_fixture()
.
-
testing.tests.cpp_long_names.
remove_absurd_directory_structure
()[source]¶ Remove the absurd directory structure when
RUN_ABSURD_TEST
isTrue
.Helper function for the testing fixture
potentially_with_insanity_fixture()
.
-
testing.tests.cpp_long_names.
potentially_with_insanity_fixture
()[source]¶ Class-level fixture that may create / remove the absurd directory.
This will create the absurd directory structure before any tests are run, and remove it when all are finished when
RUN_ABSURD_TEST
isTrue
.
-
testing.tests.cpp_long_names.
potentially_with_insanity
(cls)[source]¶ Mark
cls
to use the fixturepotentially_with_insanity()
.Parameters
cls
(CPPLongNames
)Decorator designed only for
CPPLongNames
.Return (
CPPLongNames
)The input
cls
, after executingpytest.mark.usefixtures
.
-
class
testing.tests.cpp_long_names.
CPPLongNames
(methodName='runTest')[source]¶ Primary test class for project
cpp_long_names
.-
test_project
= 'cpp_long_names'¶ Test Project Source
View the cpp_long_names source code here. See also:
ExhaleTestCase.test_project
.
-
file_hierarchy_dict
= {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.file object>: {<testing.hierarchies.function object>: <testing.hierarchies.parameters object>}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}, <testing.hierarchies.file object>: {<testing.hierarchies.define object>: {}, <testing.hierarchies.enum object>: {}, <testing.hierarchies.function object>: <testing.hierarchies.parameters object>, <testing.hierarchies.namespace object>: {<testing.hierarchies.variable object>: {}}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.define object>: {}, <testing.hierarchies.typedef object>: {}, <testing.hierarchies.union object>: {}, <testing.hierarchies.variable object>: {}}}}¶ The (potentially absurd) file hierarchy for this project.
-
cpp_nesting
¶
Tests for the cpp_nesting
project.
-
class
testing.tests.cpp_nesting.
CPPNesting
(methodName='runTest')[source]¶ Primary test class for project
cpp_nesting
.-
test_project
= 'cpp_nesting'¶ Test Project Source
View the cpp_nesting source code here. See also:
ExhaleTestCase.test_project
.
-
cpp_pimpl
¶
Tests for the cpp_nesting
project.
-
class
testing.tests.cpp_pimpl.
TestedExclusionTypes
[source]¶ An “enum” for listing exclusions we care about.
Yes, I still need to support python 2.
-
NoExclusions
= 0¶ No exclusions were requested.
-
AllImpl
= 1¶ All
r".*Impl$"
should be excluded.
-
DetailImpl
= 2¶ Only
r".*detail::.*Impl$"
should be excluded.
-
-
class
testing.tests.cpp_pimpl.
CPPPimpl
(methodName='runTest')[source]¶ Primary test class for project
cpp_pimpl
.-
test_project
= 'cpp_pimpl'¶ Test Project Source
View the cpp_pimpl source code here. See also:
ExhaleTestCase.test_project
.
-
file_hierarchy_dict
= {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.file object>: {<testing.hierarchies.namespace object>: {<testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.namespace object>: {<testing.hierarchies.clike object>: {}}}}, <testing.hierarchies.file object>: {<testing.hierarchies.namespace object>: {<testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.namespace object>: {<testing.hierarchies.clike object>: {}}}}, <testing.hierarchies.file object>: {<testing.hierarchies.namespace object>: {<testing.hierarchies.clike object>: {}}}}}}¶ The file hierarchy for this test.
-
class_hierarchy_dict
= {<testing.hierarchies.namespace object>: {<testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}, <testing.hierarchies.namespace object>: {<testing.hierarchies.clike object>: {}, <testing.hierarchies.clike object>: {}}}}¶ The class hierarchy for this test.
-
link_name_format_dict
()[source]¶ Return a dictionary suitable for using with
str.format
.Since Doxygen will behave differently on different platforms with respect to what the specific
refid
of a given node is, which affect the generatedlink_name
for a givenExhaleNode
, they must be searched for after exhale runs for the given test function.- Return (
dict
) A dictionary with string keys and string values is returned, the key-value pairs are
{name}
:{compound.link_name}
:Key
C++ Compound
link_name
"pimpl"
namespace pimpl
"pimpl_detail"
namespace detail::pimpl
"pimpl_detail_EarthImpl"
class pimpl::detail::EarthImpl
"pimpl_detail_JupiterImpl"
class pimpl::detail::JupiterImpl
"pimpl_Earth"
class pimpl::Earth
"pimpl_Earth_v2"
class pimpl::Earth_v2
"pimpl_EarthImpl"
class pimpl::EarthImpl
"pimpl_Jupiter"
class pimpl::Jupiter
"pimpl_Jupiter_v2"
class pimpl::Jupiter_v2
"pimpl_JupiterImpl"
class pimpl::JupiterImpl
"pimpl_Planet"
class pimpl::Planet
- Return (
-
expected_class_hierarchy
(exclusions)[source]¶ Return expected rst class hiearchy listing based on specified
exclusions
.Helper method for
validate_class_hierarchy()
.Parameters
exclusions
(TestedExclusionTypes
)The exclusion that is currently being tested.
- Return (
str
) The expected rst class listing. If
exclusions
is invalid, then the string"INTERNAL TESTING ERROR"
is returned.
-
validate_class_hierarchy
(exclusions)[source]¶ Validate generated class hierarchy rst list is correct based on
exclusions
.Parameters
exclusions
(TestedExclusionTypes
)The exclusion that is currently being tested.
-
validate_namespace_listings
(exclusions)[source]¶ Validate generated namespace rst listings are correct based on
exclusions
.This project contains two namespaces that are tested:
namespace pimpl
andnamespace pimpl::detail
.Parameters
exclusions
(TestedExclusionTypes
)The exclusion that is currently being tested.
-
validate_file_listings
()[source]¶ Validate
{earth,jupiter}.hpp
link to all items (regardless of"listingExclude"
).
-
test_no_listing_exclusions
()[source]¶ Verify empty listing exclude results in no change in listed API.
-
test_impl_exclude_ignorecase
()[source]¶ Verify
r".*impl$
withre.IGNORECASE
excludes*Impl
items.
-
test_detail_impl_exclude_ignorecase
()[source]¶ Verify
r".*detail::.*impl$
withre.IGNORECASE
excludes*detail::*Impl
items.
-
cpp with spaces
¶
Tests for the cpp_with_spaces
project.
-
class
testing.tests.cpp_with_spaces.
CPPWithSpaces
(methodName='runTest')[source]¶ Primary test class for project
cpp with spaces
.-
test_project
= 'cpp with spaces'¶ Test Project Source
View the cpp with spaces source code here. See also:
ExhaleTestCase.test_project
.
-
file_hierarchy_dict
= {<testing.hierarchies.directory object>: {<testing.hierarchies.directory object>: {<testing.hierarchies.file object>: {<testing.hierarchies.namespace object>: {<testing.hierarchies.function object>: <testing.hierarchies.parameters object>}}}}}¶ The file hierarchy for this project.
-