summaryrefslogtreecommitdiffstats
path: root/src/boost/tools/boostbook/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/boost/tools/boostbook/test/Jamfile.v213
-rw-r--r--src/boost/tools/boostbook/test/alt.xml47
-rw-r--r--src/boost/tools/boostbook/test/doxygen/Jamfile.v241
-rw-r--r--src/boost/tools/boostbook/test/doxygen/autodoc.gold113
-rw-r--r--src/boost/tools/boostbook/test/doxygen/boost/example.hpp233
-rw-r--r--src/boost/tools/boostbook/test/doxygen/example.xml13
6 files changed, 460 insertions, 0 deletions
diff --git a/src/boost/tools/boostbook/test/Jamfile.v2 b/src/boost/tools/boostbook/test/Jamfile.v2
new file mode 100644
index 000000000..fc72f13bb
--- /dev/null
+++ b/src/boost/tools/boostbook/test/Jamfile.v2
@@ -0,0 +1,13 @@
+# Copyright (c) 2009 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 /boost/boostbook/test ;
+using boostbook ;
+
+boostbook alt : alt.xml :
+ <xsl:param>boost.root=../../../..
+ ;
+
diff --git a/src/boost/tools/boostbook/test/alt.xml b/src/boost/tools/boostbook/test/alt.xml
new file mode 100644
index 000000000..aed8a75f1
--- /dev/null
+++ b/src/boost/tools/boostbook/test/alt.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+Copyright Daniel James 2009
+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)
+-->
+
+<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML//EN"
+ "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+
+<!--
+ xmllint:
+
+ XML_CATALOG_FILES=../../../bin.v2/boostbook_catalog.xml xmllint -noout -valid alt.xml
+
+-->
+
+<library name="Example" id="test.alt" dirname="test/alt">
+ <libraryinfo>
+ <author>
+ <firstname>Daniel</firstname>
+ <surname>James</surname>
+ </author>
+ <librarypurpose>Fictional example</librarypurpose>
+ </libraryinfo>
+
+ <title>Fictional example library, for testing</title>
+
+ <section id="test.alt.tests">
+ <title>Alt Tests</title>
+
+ <para><headername alt="example.hpp">Example header</headername></para>
+ <para>Example header: <headername>example.hpp</headername></para>
+
+ <para><macroname alt="EXAMPLE">Example macro</macroname></para>
+ <para>Example macro: <macroname>EXAMPLE</macroname></para>
+ </section>
+
+ <library-reference>
+ <header name="example.hpp">
+ <macro name="EXAMPLE" kind="functionlike">
+ <purpose>Example macro</purpose>
+ </macro>
+ </header>
+ </library-reference>
+</library>
diff --git a/src/boost/tools/boostbook/test/doxygen/Jamfile.v2 b/src/boost/tools/boostbook/test/doxygen/Jamfile.v2
new file mode 100644
index 000000000..d9f34f046
--- /dev/null
+++ b/src/boost/tools/boostbook/test/doxygen/Jamfile.v2
@@ -0,0 +1,41 @@
+
+# Copyright 2009 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)
+
+using boostbook ;
+using doxygen ;
+import os ;
+
+doxygen autodoc
+ :
+ [ glob boost/*.hpp ]
+ :
+ <xsl:param>"boost.doxygen.reftitle=Example Reference"
+ ;
+
+if [ os.name ] = NT
+{
+ actions compare
+ {
+ comp /A $(>[1]) $(>[2]) && echo "Stamped" >$(<)
+ }
+
+}
+else
+{
+ actions compare
+ {
+ diff -u -w $(>[1]) $(>[2]) && echo "Stamped" >$(<)
+ }
+}
+
+make check : autodoc.xml autodoc.gold : @compare ;
+
+boostbook standalone
+ :
+ example.xml
+ :
+ <xsl:param>boost.root=../../../../..
+ <dependency>autodoc
+ ;
diff --git a/src/boost/tools/boostbook/test/doxygen/autodoc.gold b/src/boost/tools/boostbook/test/doxygen/autodoc.gold
new file mode 100644
index 000000000..58434b12f
--- /dev/null
+++ b/src/boost/tools/boostbook/test/doxygen/autodoc.gold
@@ -0,0 +1,113 @@
+<?xml version="1.0" standalone="yes"?>
+<library-reference id="example_reference"><title>Example Reference</title><header name="boost/example.hpp">
+<namespace name="example">
+<class name="example"><purpose>Documentation for class example. </purpose><description><para>Detailed documentation</para><para><programlisting language="c++">void class_code_sample();
+</programlisting> </para></description><class name="inner_class"><data-member name="x"><type>int</type></data-member>
+</class><enum name="class_enum"><enumvalue name="enumerator"/></enum>
+<typedef name="documented_type1"><description><para>This type has documentation. </para></description><type>int</type></typedef>
+<typedef name="documented_type2"><purpose>This type has documentation. </purpose><type>long</type></typedef>
+<typedef name="documented_type3"><description><para>This type has documentation. </para></description><type>long double</type></typedef>
+<typedef name="undocumented_type1"><type>short</type></typedef>
+<typedef name="undocumented_type2"><type>double</type></typedef>
+<data-member name="integer"><type>int</type></data-member>
+<data-member name="mutable_integer" specifiers="mutable"><type>int</type></data-member>
+<data-member name="const_integer"><type>const int</type></data-member>
+<data-member name="static_integer" specifiers="static"><type>int</type></data-member>
+<data-member name="static_const_integer" specifiers="static"><type>const int</type></data-member>
+<method-group name="public member functions">
+<method name="virtual_method" specifiers="virtual"><type>int</type></method>
+<method name="virtual_abstract_method" cv="= 0" specifiers="virtual"><type>int</type></method>
+<method name="virtual_const_method" cv="const" specifiers="virtual"><type>int</type></method>
+<method name="method_with_default_value"><type>int</type><parameter name=""><paramtype>int</paramtype><default>default_value</default></parameter></method>
+<method name="method_with_fp"><type>int</type><parameter name="fp"><paramtype>int(*)()</paramtype></parameter><parameter name=""><paramtype>volatile char</paramtype></parameter></method>
+<method name="method_with_string_default1"><type>int</type><parameter name=""><paramtype>char *</paramtype><default>")"</default></parameter><parameter name=""><paramtype>volatile char</paramtype></parameter></method>
+<method name="method_with_string_default2"><type>int</type><parameter name=""><paramtype>char *</paramtype><default>"("</default></parameter><parameter name=""><paramtype>volatile char</paramtype></parameter></method>
+<method name="method_with_char_default1"><type>int</type><parameter name=""><paramtype>char</paramtype><default>'('</default></parameter><parameter name=""><paramtype>volatile char</paramtype></parameter></method>
+<method name="method_with_char_default2"><type>int</type><parameter name=""><paramtype>char</paramtype><default>')'</default></parameter><parameter name=""><paramtype>volatile char</paramtype></parameter></method>
+<method name="volatile_method_with_fp" cv="volatile"><type>int</type><parameter name="fp"><paramtype>int(*)()</paramtype></parameter><parameter name=""><paramtype>volatile char</paramtype></parameter></method>
+<method name="volatile_method_with_string_default1" cv="volatile"><type>int</type><parameter name=""><paramtype>char *</paramtype><default>")"</default></parameter><parameter name=""><paramtype>volatile char</paramtype></parameter></method>
+<method name="volatile_method_with_string_default2" cv="volatile"><type>int</type><parameter name=""><paramtype>char *</paramtype><default>"("</default></parameter><parameter name=""><paramtype>volatile char</paramtype></parameter></method>
+<method name="volatile_method_with_char_default1" cv="volatile"><type>int</type><parameter name=""><paramtype>char</paramtype><default>'('</default></parameter><parameter name=""><paramtype>volatile char</paramtype></parameter></method>
+<method name="volatile_method_with_char_default2" cv="volatile"><type>int</type><parameter name=""><paramtype>char</paramtype><default>')'</default></parameter><parameter name=""><paramtype>volatile char</paramtype></parameter></method>
+<method name="const_method" cv="const"><type>void</type></method>
+<method name="volatile_method" cv="volatile"><type>void</type></method>
+<method name="trad_noexcept" cv="noexcept"><type>void</type></method>
+<method name="trad_noexcept_if" cv="noexcept(a==b &amp;&amp;(c||d)))"><type>void</type></method>
+<method name="boost_noexcept" cv="noexcept"><type>void</type></method>
+<method name="boost_noexcept_if" cv="noexcept(condition)"><type>void</type></method>
+<method name="trad_constexpr" cv="constexpr"><type>void</type></method>
+<method name="boost_constexpr" cv="constexpr"><type>void</type></method>
+<method name="boost_constexpr_or_const" cv="constexpr"><type>void</type></method>
+<method name="constexpr_noexcept" cv="constexpr noexcept"><type>void</type></method>
+<method name="conversion-operator" specifiers="explicit"><type>int</type></method>
+</method-group>
+<constructor cv="= default"><parameter name=""><paramtype><classname>example</classname> const &amp;</paramtype></parameter></constructor>
+<copy-assignment cv="= delete"><type><classname>example</classname> &amp;</type><parameter name=""><paramtype><classname>example</classname> const &amp;</paramtype></parameter></copy-assignment>
+<method-group name="public static functions">
+<method name="static_method" specifiers="static"><type>int</type></method>
+<method name="static_constexpr" cv="constexpr" specifiers="static"><type>int</type></method>
+</method-group>
+</class><struct name="example_template"><template>
+ <template-type-parameter name="TypeParameter"><purpose><para>A template parameter </para></purpose></template-type-parameter>
+ <template-nontype-parameter name="NonTypeParameter"><type>int</type><purpose><para>This is a non-type template parameter </para></purpose></template-nontype-parameter>
+ <template-type-parameter name="TypeParameterWithDefault"><default>int</default><purpose><para>This is a template parameter with a default argument </para></purpose></template-type-parameter>
+ </template><description><para>Test some doxygen markup</para><para><warning><para>This is just an example.</para></warning>
+Embedded docbook list:</para><para>
+<orderedlist><listitem><simpara>1</simpara></listitem><listitem><simpara>2</simpara></listitem></orderedlist>
+</para><para><emphasis>Special</emphasis> <emphasis role="bold">Bold</emphasis> <computeroutput>Typewriter</computeroutput> <emphasis>Italics</emphasis> <emphasis>emphasis</emphasis> <computeroutput>parameter</computeroutput> </para><para><itemizedlist>
+<listitem><para>Arg1 first argument. </para></listitem>
+<listitem><para>Arg2 second argument.</para></listitem>
+</itemizedlist>
+<itemizedlist>
+<listitem><para>First list item. </para></listitem>
+<listitem><para>Second list item</para></listitem>
+</itemizedlist>
+Line 1<sbr/>
+Line 2</para><para><programlisting language="c++">void foo() {}
+void foo2() {}
+</programlisting></para><para><programlisting language="c++">void bar() {}
+
+void bar2() {}
+</programlisting></para><para>Alternative way of writing code, has a complicated workaround because doxygen treats the empty line as a paragraph separator:</para><programlisting>
+int bar();
+
+int bar2();
+</programlisting><para>Unfortunately the workaround will merge consecutive blocks, like this:</para><programlisting>
+int foo();
+
+
+
+int foo2();
+</programlisting><para>
+</para></description></struct><struct name="specialization_test"><template>
+ <template-type-parameter name="T"/>
+ </template></struct><struct-specialization name="specialization_test"><template>
+ <template-type-parameter name="T"/>
+ </template><specialization><template-arg>T *</template-arg></specialization><method-group name="public member functions">
+</method-group>
+<constructor><description><para>A constructor. </para></description></constructor>
+<destructor><description><para>A destructor. </para></description></destructor>
+<copy-assignment><type><emphasis>unspecified</emphasis></type><parameter name=""><paramtype>const <classname>specialization_test</classname> &amp;</paramtype></parameter><description><para>An assignment operator. </para></description></copy-assignment>
+</struct-specialization><enum name="namespace_enum"><enumvalue name="enumerator"/></enum>
+<data-member name="namespace_integer"><type>int</type></data-member>
+<data-member name="namespace_static_integer" specifiers="static"><type>int</type></data-member>
+<data-member name="namespace_const_integer"><type>const int</type></data-member>
+<data-member name="namespace_static_const_integer" specifiers="static"><type>const int</type></data-member>
+<function name="free_function"><type>void</type><parameter name="x"><paramtype>int</paramtype><description><para>Parameter description.</para></description></parameter><description><para>
+<programlisting language="c++">void function_code_sample();
+</programlisting> </para></description></function>
+<function name="namespace_func"><type>int</type><parameter name="i"><paramtype>int</paramtype><description><para>A function parameter </para></description></parameter><parameter name="j"><paramtype>int</paramtype><description><para>Another </para></description></parameter><description><para>
+
+
+This is a test function. <classname alt="example::example">Link to class</classname> <classname alt="example::example_template">Link to class template</classname> <note><para>This is a note.</para></note>
+<para><emphasis role="bold">See Also:</emphasis><para><classname alt="example::example">example::example</classname> and <classname alt="example::example_template">example_template</classname> </para></para>
+</para></description><requires><para>i &gt; j</para></requires><returns><para>The answer </para></returns></function>
+<function name="namespace_func_template"><type>void</type><template>
+ <template-type-parameter name="TypeParameter"><purpose><para>A template parameter </para></purpose></template-type-parameter>
+ <template-nontype-parameter name="NonTypeParameter"><type>int</type><purpose><para>This is a non-type template parameter </para></purpose></template-nontype-parameter>
+ </template><description><para>Testing a function template.
+</para></description></function>
+</namespace>
+<macro name="EXAMPLE" kind="functionlike"><macro-parameter name="m"/><purpose>Documentation for macro example. </purpose></macro>
+</header>
+</library-reference> \ No newline at end of file
diff --git a/src/boost/tools/boostbook/test/doxygen/boost/example.hpp b/src/boost/tools/boostbook/test/doxygen/boost/example.hpp
new file mode 100644
index 000000000..9b32da0bd
--- /dev/null
+++ b/src/boost/tools/boostbook/test/doxygen/boost/example.hpp
@@ -0,0 +1,233 @@
+
+// Copyright 2009 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)
+
+/*!
+ \class example::example
+
+ \brief Documentation for class example
+
+ Detailed documentation
+
+ \code{.cpp}
+ void class_code_sample();
+ \endcode
+ */
+
+/*!
+ \def EXAMPLE
+
+ \brief Documentation for macro example
+ */
+
+int global_integer;
+static int global_static_integer;
+const int global_const_integer = 1;
+static const int global_static_const_integer = 2;
+enum global_enum { enumerator1 = 1, enumerator2 };
+
+namespace example
+{
+ /*!
+
+ \param x Parameter description.
+
+ \code{.cpp}
+ void function_code_sample();
+ \endcode
+ */
+ void free_function(int x);
+
+ int namespace_integer;
+ static int namespace_static_integer;
+ const int namespace_const_integer = 1;
+ static const int namespace_static_const_integer = 2;
+ enum namespace_enum { enumerator };
+
+ class example
+ {
+ public:
+ example(example const&) = default;
+ example& operator=(example const&) = delete;
+ virtual int virtual_method();
+ virtual int virtual_abstract_method() = 0;
+ virtual int virtual_const_method() const;
+ int method_with_default_value(int = default_value);
+
+ int method_with_fp(int (*fp)(), volatile char);
+ int method_with_string_default1(char* = ")", volatile char);
+ int method_with_string_default2(char* = "(", volatile char);
+ int method_with_char_default1(char = '(', volatile char);
+ int method_with_char_default2(char = ')', volatile char);
+
+ int volatile_method_with_fp(int (*fp)(), volatile char) volatile;
+ int volatile_method_with_string_default1(char* = ")", volatile char) volatile;
+ int volatile_method_with_string_default2(char* = "(", volatile char) volatile;
+ int volatile_method_with_char_default1(char = '(', volatile char) volatile;
+ int volatile_method_with_char_default2(char = ')', volatile char) volatile;
+
+ void const_method() const;
+ void volatile_method() volatile;
+
+ void trad_noexcept() noexcept;
+ void trad_noexcept_if() noexcept(a == b && (c || d));
+ void boost_noexcept() BOOST_NOEXCEPT;
+ void boost_noexcept_if() BOOST_NOEXCEPT_IF(a == b && (c || d));
+
+ void trad_constexpr() constexpr;
+ void boost_constexpr() BOOST_CONSTEXPR;
+ void boost_constexpr_or_const() BOOST_CONSTEXPR_OR_CONST;
+
+ void constexpr_noexcept() constexpr noexcept;
+
+ static int static_method();
+ static int static_constexpr() constexpr;
+
+ int integer;
+ static int static_integer;
+ mutable int mutable_integer;
+ const int const_integer;
+ static const int static_const_integer;
+
+ // Visual check of typedef alignment.
+ /** This type has documentation. */
+ typedef int documented_type1;
+ /** \brief This type has documentation. */
+ typedef long documented_type2;
+ /** This type has documentation. */
+ typedef long double documented_type3;
+ typedef short undocumented_type1;
+ typedef double undocumented_type2;
+
+ class inner_class {
+ public:
+ int x;
+ };
+
+ enum class_enum { enumerator };
+
+ /// INTERNAL ONLY
+ enum internal_enum { internal_enumerator };
+
+ explicit operator int();
+ protected:
+ int protected_integer;
+ static int protected_static_integer;
+ mutable int protected_mutable_integer;
+ const int protected_const_integer;
+ static const int protected_static_const_integer;
+
+ enum protected_class_enum { enumerator2 };
+ private:
+ int private_integer;
+ static int private_static_integer;
+ mutable int private_mutable_integer;
+ const int private_const_integer;
+ static const int private_static_const_integer;
+
+ enum private_class_enum { enumerator3 };
+ };
+
+ /**
+ * Test some doxygen markup
+ *
+ * \warning This is just an example.
+ *
+ * Embedded docbook list:
+ *
+ * \xmlonly
+ * <orderedlist><listitem><simpara>1</simpara></listitem><listitem><simpara>2</simpara></listitem></orderedlist>
+ * \endxmlonly
+ *
+ * \a Special \b Bold \c Typewriter \e Italics \em emphasis \p parameter
+ *
+ * \arg Arg1 first argument.
+ * \arg Arg2 second argument.
+ *
+ * \li First list item.
+ * \li Second list item
+ *
+ * Line 1\n
+ * Line 2
+ *
+ * \code
+ * void foo() {}
+ * void foo2() {}
+ * \endcode
+ *
+ * \code
+ * void bar() {}
+ *
+ * void bar2() {}
+ * \endcode
+ *
+ * Alternative way of writing code, has a complicated workaround
+ * because doxygen treats the empty line as a paragraph
+ * separator:
+ *
+ * <pre>
+ * int bar();
+ *
+ * int bar2();
+ * </pre>
+ *
+ * Unfortunately the workaround will merge consecutive blocks,
+ * like this:
+ *
+ * <pre>
+ * int foo();
+ * </pre>
+ *
+ * <pre>
+ * int foo2();
+ * </pre>
+ *
+ * \tparam TypeParameter A template parameter
+ * \tparam NonTypeParameter This is a non-type template parameter
+ * \tparam TypeParameterWithDefault This is a template parameter with a default argument
+ */
+
+ template <typename TypeParameter, int NonTypeParameter,
+ typename TypeParameterWithDefault = int>
+ struct example_template {};
+
+ /**
+ * \param i A function parameter
+ * \param j Another
+ * \return The answer
+ * \pre i > j
+ *
+ * This is a test function.
+ * \ref example::example "Link to class"
+ * \ref example_template "Link to class template"
+ * \note This is a note.
+ *
+ * \see example::example and example_template
+ */
+ int namespace_func(int i, int j);
+
+ /**
+ * Testing a function template.
+ * \tparam TypeParameter A template parameter
+ * \tparam NonTypeParameter This is a non-type template parameter
+ */
+ template <typename TypeParameter, int NonTypeParameter>
+ void namespace_func_template();
+
+ template<class T>
+ struct specialization_test {
+ };
+
+ template<class T>
+ struct specialization_test<T*> {
+ /** A constructor. */
+ specialization_test();
+ /** A destructor. */
+ ~specialization_test();
+ /** An assignment operator. */
+ detail::unspecified& operator=(const specialization_test&);
+ };
+}
+
+#define EXAMPLE(m) The macro
diff --git a/src/boost/tools/boostbook/test/doxygen/example.xml b/src/boost/tools/boostbook/test/doxygen/example.xml
new file mode 100644
index 000000000..1858ce4c8
--- /dev/null
+++ b/src/boost/tools/boostbook/test/doxygen/example.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright Daniel James 2009
+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)
+-->
+
+<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<library id="example" name="Example" dirname="example" xmlns:xi="http://www.w3.org/2001/XInclude">
+<title>Example</title>
+<xi:include href="autodoc.xml" />
+</library>