diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/tools/quickbook/test/snippets | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/tools/quickbook/test/snippets')
13 files changed, 212 insertions, 0 deletions
diff --git a/src/boost/tools/quickbook/test/snippets/Jamfile.v2 b/src/boost/tools/quickbook/test/snippets/Jamfile.v2 new file mode 100644 index 00000000..6765dff9 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/Jamfile.v2 @@ -0,0 +1,18 @@ +# +# Copyright (c) 2011 Daniel James +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +project quickbook/test/snippets ; + +import quickbook-testing : quickbook-test quickbook-error-test ; + +test-suite quickbook.test : + [ quickbook-test pass_thru ] + [ quickbook-test unbalanced_snippet1-1_5 ] + [ quickbook-error-test unbalanced_snippet1-1_6-fail ] + [ quickbook-error-test unbalanced_snippet2-1_6-fail ] + ; diff --git a/src/boost/tools/quickbook/test/snippets/pass_thru.cpp b/src/boost/tools/quickbook/test/snippets/pass_thru.cpp new file mode 100644 index 00000000..c5c120a1 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/pass_thru.cpp @@ -0,0 +1,33 @@ +// clang-format off + +//[foo_cpp_copyright +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +//] + +//[foo_cpp +struct Foo{ + + Foo()//=; +//<- + : x( 10 ) + {} +//-> + +//<- + int x; +//-> +}; + +/*= +int main() +{ + Foo x; +} +*/ +//] diff --git a/src/boost/tools/quickbook/test/snippets/pass_thru.gold b/src/boost/tools/quickbook/test/snippets/pass_thru.gold new file mode 100644 index 00000000..dde5deb1 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/pass_thru.gold @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="pass_thru_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Pass thru test</title> + <para> +<programlisting><phrase role="comment">/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/</phrase> +</programlisting> + </para> + <para> +<programlisting><phrase role="keyword">struct</phrase> <phrase role="identifier">Foo</phrase><phrase role="special">{</phrase> + + <phrase role="identifier">Foo</phrase><phrase role="special">();</phrase> + +<phrase role="special">};</phrase> + + +<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> +<phrase role="special">{</phrase> + <phrase role="identifier">Foo</phrase> <phrase role="identifier">x</phrase><phrase role="special">;</phrase> +<phrase role="special">}</phrase> +</programlisting> + </para> + <para> +<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">:</phrase> + <phrase role="keyword">print</phrase><phrase role="special">(</phrase><phrase role="string">'foo'</phrase><phrase role="special">)</phrase> +</programlisting> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/snippets/pass_thru.gold-html b/src/boost/tools/quickbook/test/snippets/pass_thru.gold-html new file mode 100644 index 00000000..ba0237dd --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/pass_thru.gold-html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Pass thru test + </h3> + <p> +<pre class="programlisting"><span class="comment">/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/</span> +</pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">Foo</span><span class="special">{</span> + + <span class="identifier">Foo</span><span class="special">();</span> + +<span class="special">};</span> + + +<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> +<span class="special">{</span> + <span class="identifier">Foo</span> <span class="identifier">x</span><span class="special">;</span> +<span class="special">}</span> +</pre> + </p> + <p> +<pre class="programlisting"><span class="keyword">def</span> <span class="identifier">foo</span><span class="special">:</span> + <span class="keyword">print</span><span class="special">(</span><span class="string">'foo'</span><span class="special">)</span> +</pre> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/snippets/pass_thru.py b/src/boost/tools/quickbook/test/snippets/pass_thru.py new file mode 100644 index 00000000..412cee42 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/pass_thru.py @@ -0,0 +1,13 @@ +# Copyright (c) 2011 Daniel James +# +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +#[foo_py +def foo: + #=print('foo') + #<- + print('bar') + #-> +#]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/snippets/pass_thru.quickbook b/src/boost/tools/quickbook/test/snippets/pass_thru.quickbook new file mode 100644 index 00000000..7e831947 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/pass_thru.quickbook @@ -0,0 +1,12 @@ +[article Pass thru test +[quickbook 1.5] +] + +[import pass_thru.cpp] +[import pass_thru.py] + +[foo_cpp_copyright] + +[foo_cpp] + +[foo_py]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold new file mode 100644 index 00000000..1f9115c0 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> +<article id="unbalanced_snippet_fail_test_1" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Unbalanced snippet fail test 1</title> + <para> +<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase> +</programlisting> + </para> +</article> diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold-html b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold-html new file mode 100644 index 00000000..af90d9d3 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold-html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> + <head></head> + <body> + <h3> + Unbalanced snippet fail test 1 + </h3> + <p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{}</span> +</pre> + </p> + </body> +</html> diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.quickbook b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.quickbook new file mode 100644 index 00000000..7fdde6af --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.quickbook @@ -0,0 +1,8 @@ +[article Unbalanced snippet fail test 1 +[quickbook 1.5] +] + +[import unbalanced_snippet1.cpp] +[import unbalanced_snippet2.cpp] + +[unclosed]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_6-fail.quickbook b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_6-fail.quickbook new file mode 100644 index 00000000..c2fb98ec --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1-1_6-fail.quickbook @@ -0,0 +1,7 @@ +[article Unbalanced snippet fail test 1 +[quickbook 1.6] +] + +[import unbalanced_snippet1.cpp] + +[unclosed]
\ No newline at end of file diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1.cpp b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1.cpp new file mode 100644 index 00000000..ee598391 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet1.cpp @@ -0,0 +1,11 @@ +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//[unclosed + +int main() {} diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2-1_6-fail.quickbook b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2-1_6-fail.quickbook new file mode 100644 index 00000000..a06a1644 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2-1_6-fail.quickbook @@ -0,0 +1,5 @@ +[article Unbalanced snippet fail test 2 +[quickbook 1.6] +] + +[import unbalanced_snippet2.cpp] diff --git a/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2.cpp b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2.cpp new file mode 100644 index 00000000..b2fcb247 --- /dev/null +++ b/src/boost/tools/quickbook/test/snippets/unbalanced_snippet2.cpp @@ -0,0 +1,9 @@ +//] + +/*============================================================================= + Copyright (c) 2011 Daniel James + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ |