diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 12:57:26 -0700 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 12:57:26 -0700 |
commit | 1a78a62555be32868418fe52f8e330c9d0f95d5a (patch) | |
tree | d3765a80e7d3b9640ec2e930743630cd6b9fce2b /tools/quickbook/test/snippets | |
download | boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.gz boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.bz2 boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.zip |
Imported Upstream version 1.49.0upstream/1.49.0
Diffstat (limited to 'tools/quickbook/test/snippets')
11 files changed, 143 insertions, 0 deletions
diff --git a/tools/quickbook/test/snippets/Jamfile.v2 b/tools/quickbook/test/snippets/Jamfile.v2 new file mode 100644 index 0000000000..4dfd0d0e8f --- /dev/null +++ b/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 quickook/tests/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/tools/quickbook/test/snippets/pass_thru.cpp b/tools/quickbook/test/snippets/pass_thru.cpp new file mode 100644 index 0000000000..4d729d3599 --- /dev/null +++ b/tools/quickbook/test/snippets/pass_thru.cpp @@ -0,0 +1,31 @@ +//[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/tools/quickbook/test/snippets/pass_thru.gold b/tools/quickbook/test/snippets/pass_thru.gold new file mode 100644 index 0000000000..dde5deb19c --- /dev/null +++ b/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/tools/quickbook/test/snippets/pass_thru.py b/tools/quickbook/test/snippets/pass_thru.py new file mode 100644 index 0000000000..412cee420f --- /dev/null +++ b/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/tools/quickbook/test/snippets/pass_thru.quickbook b/tools/quickbook/test/snippets/pass_thru.quickbook new file mode 100644 index 0000000000..7e83194784 --- /dev/null +++ b/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/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold b/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.gold new file mode 100644 index 0000000000..1f9115c0f5 --- /dev/null +++ b/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/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.quickbook b/tools/quickbook/test/snippets/unbalanced_snippet1-1_5.quickbook new file mode 100644 index 0000000000..7fdde6afdd --- /dev/null +++ b/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/tools/quickbook/test/snippets/unbalanced_snippet1-1_6-fail.quickbook b/tools/quickbook/test/snippets/unbalanced_snippet1-1_6-fail.quickbook new file mode 100644 index 0000000000..c2fb98ec0a --- /dev/null +++ b/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/tools/quickbook/test/snippets/unbalanced_snippet1.cpp b/tools/quickbook/test/snippets/unbalanced_snippet1.cpp new file mode 100644 index 0000000000..ec49a78878 --- /dev/null +++ b/tools/quickbook/test/snippets/unbalanced_snippet1.cpp @@ -0,0 +1,3 @@ +//[unclosed + +int main() {}
\ No newline at end of file diff --git a/tools/quickbook/test/snippets/unbalanced_snippet2-1_6-fail.quickbook b/tools/quickbook/test/snippets/unbalanced_snippet2-1_6-fail.quickbook new file mode 100644 index 0000000000..a06a16448b --- /dev/null +++ b/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/tools/quickbook/test/snippets/unbalanced_snippet2.cpp b/tools/quickbook/test/snippets/unbalanced_snippet2.cpp new file mode 100644 index 0000000000..b0575171ea --- /dev/null +++ b/tools/quickbook/test/snippets/unbalanced_snippet2.cpp @@ -0,0 +1 @@ +//]
\ No newline at end of file |