From 9ba9e170855ad5850adda45de80e31025c5a30c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 May 2020 17:10:47 +0200 Subject: [PATCH] Yet another variant of a graphviz dot output. --- .../test_doxygen/contents_custom/dot-240.html | 67 ++++ .../test_doxygen/contents_custom/dot.html | 24 +- .../test_doxygen/contents_dot/index-240.html | 132 ++++++++ .../test_doxygen/contents_dot/index.html | 82 ++--- documentation/test_doxygen/test_contents.py | 39 ++- .../test_python/page_plugins/dot-240.html | 61 ++++ .../test_python/page_plugins/dot.html | 22 +- documentation/test_python/test_page.py | 12 +- plugins/m/test/dot/page-240.html | 289 ++++++++++++++++++ plugins/m/test/dot/page.html | 184 +++++------ plugins/m/test/test_dot.py | 19 +- 11 files changed, 739 insertions(+), 192 deletions(-) create mode 100644 documentation/test_doxygen/contents_custom/dot-240.html create mode 100644 documentation/test_doxygen/contents_dot/index-240.html create mode 100644 documentation/test_python/page_plugins/dot-240.html create mode 100644 plugins/m/test/dot/page-240.html diff --git a/documentation/test_doxygen/contents_custom/dot-240.html b/documentation/test_doxygen/contents_custom/dot-240.html new file mode 100644 index 00000000..7fe320bb --- /dev/null +++ b/documentation/test_doxygen/contents_custom/dot-240.html @@ -0,0 +1,67 @@ + + + + + Dot | My Project + + + + + +
+
+
+
+
+

+ Dot +

+

A red graph:

+ + +a + +a + + +b + +b + + +a--b + + + + +

A blue graph, from a file:

+ + +a + +a + + +b + +b + + +a--b + + + + +
+
+
+
+
+ + diff --git a/documentation/test_doxygen/contents_custom/dot.html b/documentation/test_doxygen/contents_custom/dot.html index 7fe320bb..153e4ebf 100644 --- a/documentation/test_doxygen/contents_custom/dot.html +++ b/documentation/test_doxygen/contents_custom/dot.html @@ -23,38 +23,38 @@ Dot

A red graph:

- + a - -a + +a b - -b + +b a--b - +

A blue graph, from a file:

- + a - -a + +a b - -b + +b a--b - + diff --git a/documentation/test_doxygen/contents_dot/index-240.html b/documentation/test_doxygen/contents_dot/index-240.html new file mode 100644 index 00000000..53bc2216 --- /dev/null +++ b/documentation/test_doxygen/contents_dot/index-240.html @@ -0,0 +1,132 @@ + + + + + My Project + + + + + +
+
+
+
+
+

+ My Project +

+

Note: the test uses DejaVu Sans instead of Source Sans Pro in order to have predictable rendering on the CIs.

+ +Basics + +a + +a + + +b + + +b + + +a->b + + + + +c + +c + + +b->c + + +0 + + +c->c + + +1 + + + +
+ +Colors + +a + +a + + +b + +b + + +a->b + + +yes + + +b->b + + +no + + + +
+ + +a + +a + + +b + +b + + +a--b + + + + +
A graph
+ + +a + +a + + +b + +b + + +a--b + + + + +
A graph
+
+
+
+
+ + diff --git a/documentation/test_doxygen/contents_dot/index.html b/documentation/test_doxygen/contents_dot/index.html index 53bc2216..7ebadebf 100644 --- a/documentation/test_doxygen/contents_dot/index.html +++ b/documentation/test_doxygen/contents_dot/index.html @@ -22,104 +22,104 @@

My Project

-

Note: the test uses DejaVu Sans instead of Source Sans Pro in order to have predictable rendering on the CIs.

- +

Note: the test uses DejaVu Sans instead of Source Sans Pro in order to have predictable rendering on the CIs.

+ Basics a - -a + +a b - - -b + + +b a->b - - + + c - -c + +c b->c - - -0 + + +0 c->c - - -1 + + +1 -
- +
+ Colors a - -a + +a b - -b + +b a->b - - -yes + + +yes b->b - - -no + + +no
- + a - -a + +a b - -b + +b a--b - +
A graph
- + a - -a + +a b - -b + +b a--b - + diff --git a/documentation/test_doxygen/test_contents.py b/documentation/test_doxygen/test_contents.py index d88ed673..72c510dc 100644 --- a/documentation/test_doxygen/test_contents.py +++ b/documentation/test_doxygen/test_contents.py @@ -279,24 +279,19 @@ class Custom(IntegrationTestCase): self.run_doxygen(wildcard='math.xml') self.assertEqual(*self.actual_expected_contents('math.html')) - @unittest.skipUnless(LooseVersion(dot_version()) >= LooseVersion("2.40.1"), - "Dot < 2.40.1 has a completely different output.") def test_dot(self): self.run_doxygen(wildcard='dot.xml') - self.assertEqual(*self.actual_expected_contents('dot.html')) - @unittest.skipUnless(LooseVersion(dot_version()) < LooseVersion("2.40.1") and - LooseVersion(dot_version()) >= LooseVersion("2.38.0"), - "Dot < 2.38 and dot > 2.38 has a completely different output.") - def test_dot238(self): - self.run_doxygen(wildcard='dot.xml') - self.assertEqual(*self.actual_expected_contents('dot.html', 'dot-238.html')) + if LooseVersion(dot_version()) >= LooseVersion("2.44.0"): + file = 'dot.html' + elif LooseVersion(dot_version()) > LooseVersion("2.40.0"): + file = 'dot-240.html' + elif LooseVersion(dot_version()) >= LooseVersion("2.38.0"): + file = 'dot-238.html' + else: + file = 'dot-236.html' - @unittest.skipUnless(LooseVersion(dot_version()) < LooseVersion("2.38.0"), - "Dot > 2.36 has a completely different output.") - def test_dot236(self): - self.run_doxygen(wildcard='dot.xml') - self.assertEqual(*self.actual_expected_contents('dot.html', 'dot-236.html')) + self.assertEqual(*self.actual_expected_contents('dot.html', file)) class ParseError(BaseTestCase): def __init__(self, *args, **kwargs): @@ -400,17 +395,17 @@ class Dot(IntegrationTestCase): def __init__(self, *args, **kwargs): super().__init__(__file__, 'dot', *args, **kwargs) - @unittest.skipUnless(LooseVersion(dot_version()) >= LooseVersion("2.40.1"), - "Dot < 2.40.1 has a completely different output.") def test(self): self.run_doxygen(wildcard='indexpage.xml') - self.assertEqual(*self.actual_expected_contents('index.html')) - @unittest.skipUnless(LooseVersion(dot_version()) < LooseVersion("2.40.1"), - "Dot < 2.40.1 has a completely different output.") - def test_238(self): - self.run_doxygen(wildcard='indexpage.xml') - self.assertEqual(*self.actual_expected_contents('index.html', 'index-238.html')) + if LooseVersion(dot_version()) >= LooseVersion("2.44.0"): + file = 'index.html' + elif LooseVersion(dot_version()) > LooseVersion("2.40.0"): + file = 'index-240.html' + elif LooseVersion(dot_version()) >= LooseVersion("2.38.0"): + file = 'index-238.html' + + self.assertEqual(*self.actual_expected_contents('index.html', file)) def test_warnings(self): self.run_doxygen(wildcard='warnings.xml') diff --git a/documentation/test_python/page_plugins/dot-240.html b/documentation/test_python/page_plugins/dot-240.html new file mode 100644 index 00000000..6f6a00bb --- /dev/null +++ b/documentation/test_python/page_plugins/dot-240.html @@ -0,0 +1,61 @@ + + + + + Dot | My Python Project + + + + + +
+
+
+
+
+

+ Dot +

+
+ + + +a + +a + + +b + +b + + +a->b + + + + +c + +c + + +b->c + + + + + +
+
+
+
+
+ + diff --git a/documentation/test_python/page_plugins/dot.html b/documentation/test_python/page_plugins/dot.html index 6f6a00bb..289e5ab7 100644 --- a/documentation/test_python/page_plugins/dot.html +++ b/documentation/test_python/page_plugins/dot.html @@ -24,31 +24,31 @@
- + a - -a + +a b - -b + +b a->b - - + + c - -c + +c b->c - - + + diff --git a/documentation/test_python/test_page.py b/documentation/test_python/test_page.py index f033a2f8..9a95f430 100644 --- a/documentation/test_python/test_page.py +++ b/documentation/test_python/test_page.py @@ -81,8 +81,16 @@ class Plugins(BaseTestCase): ] }) self.assertEqual(*self.actual_expected_contents('index.html')) - # The output is different for older Graphviz - self.assertEqual(*self.actual_expected_contents('dot.html', 'dot.html' if LooseVersion(dot_version()) >= LooseVersion("2.40.1") else 'dot-238.html')) + + # The output is different for every other Graphviz + if LooseVersion(dot_version()) >= LooseVersion("2.44.0"): + file = 'dot.html' + elif LooseVersion(dot_version()) > LooseVersion("2.40.0"): + file = 'dot-240.html' + elif LooseVersion(dot_version()) >= LooseVersion("2.38.0"): + file = 'dot-238.html' + self.assertEqual(*self.actual_expected_contents('dot.html', file)) + # I assume this will be a MASSIVE ANNOYANCE at some point as well so # keeping it separate self.assertEqual(*self.actual_expected_contents('plots.html')) diff --git a/plugins/m/test/dot/page-240.html b/plugins/m/test/dot/page-240.html new file mode 100644 index 00000000..d23a177b --- /dev/null +++ b/plugins/m/test/dot/page-240.html @@ -0,0 +1,289 @@ + + + + + m.dot | A Pelican Blog + + + + + + +
+
+
+
+
+
+

m.dot

+ +

Note: the test uses DejaVu Sans instead of Source Sans Pro in order to have +predictable rendering on the CIs.

+

Different shapes, fills etc. All default colors, filled only the first node +and the arrowheads, nothing else. Non-default font size should be preserved.

+
+ + +Basics + +a + +a + + +b + + +b + + +a->b + + + + +c + +c + + +b->c + + +0 + + +c->c + + +1 + + + +
+
+ + +More shapes + +d +outsider + + + +
+

Colors:

+
+ + +Colors + +a + +a + + +b + +b + + +a->b + + +yes + + +b->b + + +no + + + +
+

Unoriented graph without a title:

+
+ + + +a + +a + + +b + +b + + +a--b + + + +a--b + + + + +
+

Strict graphs:

+
+ + +A to B + +a + +a + + +b + +b + + +a->b + + + + + +
+
+ + +A to B + +a + +a + + +b + +b + + +a--b + + + + +
+

Structs:

+
+ + +Structs + +struct + +a + +b + +c + +d + +e + + +another + +a + +b + +c + +d + +e + + + +
+
+ + +A to B + +a + +a + + +b + +b + + +a->b + + + + + +
This is a title.
+

This is a description.

+
+
+ + + +a + +a + + +b + +b + + +a->b + + + + + +

The graph below should not be styled as a part of the figure:

+
+ + +A to B + +a + +a + + +b + +b + + +a->b + + + + + +
+
+ +
+
+
+
+
+ + diff --git a/plugins/m/test/dot/page.html b/plugins/m/test/dot/page.html index d23a177b..22777ce7 100644 --- a/plugins/m/test/dot/page.html +++ b/plugins/m/test/dot/page.html @@ -28,82 +28,82 @@ predictable rendering on the CIs.

Different shapes, fills etc. All default colors, filled only the first node and the arrowheads, nothing else. Non-default font size should be preserved.

- - + + Basics a - -a + +a b - - -b + + +b a->b - - + + c - -c + +c b->c - - -0 + + +0 c->c - - -1 + + +1
- + More shapes d -outsider +outsider

Colors:

- - + + Colors a - -a + +a b - -b + +b a->b - - -yes + + +yes b->b - - -no + + +no @@ -111,24 +111,24 @@ and the arrowheads, nothing else. Non-default font size should be preserved.

Unoriented graph without a title:

- + a - -a + +a b - -b + +b a--b - + a--b - + @@ -136,99 +136,99 @@ and the arrowheads, nothing else. Non-default font size should be preserved.

Strict graphs:

- + A to B a - -a + +a b - -b + +b a->b - - + +
- + A to B a - -a + +a b - -b + +b a--b - +

Structs:

- + Structs struct - -a - -b - + +a + +b + c - -d - -e + +d + +e another - -a - -b - -c - -d - -e + +a + +b + +c + +d + +e
- + A to B a - -a + +a b - -b + +b a->b - - + + @@ -237,43 +237,43 @@ and the arrowheads, nothing else. Non-default font size should be preserved.

- + a - -a + +a b - -b + +b a->b - - + +

The graph below should not be styled as a part of the figure:

- + A to B a - -a + +a b - -b + +b a->b - - + + diff --git a/plugins/m/test/test_dot.py b/plugins/m/test/test_dot.py index a2697c08..f889ca33 100644 --- a/plugins/m/test/test_dot.py +++ b/plugins/m/test/test_dot.py @@ -37,22 +37,17 @@ class Dot(PelicanPluginTestCase): def __init__(self, *args, **kwargs): super().__init__(__file__, '', *args, **kwargs) - @unittest.skipUnless(LooseVersion(dot_version()) >= LooseVersion("2.40.1"), - "Dot < 2.40.1 has a completely different output.") def test(self): self.run_pelican({ 'PLUGINS': ['m.htmlsanity', 'm.components', 'm.dot'], 'M_DOT_FONT': 'DejaVu Sans' }) - self.assertEqual(*self.actual_expected_contents('page.html')) + if LooseVersion(dot_version()) >= LooseVersion("2.44.0"): + file = 'page.html' + elif LooseVersion(dot_version()) > LooseVersion("2.40.0"): + file = 'page-240.html' + elif LooseVersion(dot_version()) >= LooseVersion("2.38.0"): + file = 'page-238.html' - @unittest.skipUnless(LooseVersion(dot_version()) < LooseVersion("2.40.1"), - "Dot < 2.40.1 has a completely different output.") - def test_238(self): - self.run_pelican({ - 'PLUGINS': ['m.htmlsanity', 'm.components', 'm.dot'], - 'M_DOT_FONT': 'DejaVu Sans' - }) - - self.assertEqual(*self.actual_expected_contents('page.html', 'page-238.html')) + self.assertEqual(*self.actual_expected_contents('page.html', file)) -- 2.30.2