From: Luca Heltai Date: Wed, 20 Sep 2017 10:05:59 +0000 (+0200) Subject: Test tex output. X-Git-Tag: v9.0.0-rc1~1033^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae267affdbda94de5089e48f18b51760106d05af;p=dealii.git Test tex output. --- diff --git a/tests/parameter_handler/parameter_acceptor_06.cc b/tests/parameter_handler/parameter_acceptor_06.cc new file mode 100644 index 0000000000..5353ae0b04 --- /dev/null +++ b/tests/parameter_handler/parameter_acceptor_06.cc @@ -0,0 +1,78 @@ +//----------------------------------------------------------- +// +// Copyright (C) 2015 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +//----------------------------------------------------------- + + + +#include "../tests.h" +#include +#include +#include + +class FirstClass : public ParameterAcceptor +{ +public: + FirstClass(const std::string &name = "First Class"): + ParameterAcceptor(name) + { + add_parameter("First int", f_i); + add_parameter("First double",f_d); + add_parameter("First bool", f_b); + add_parameter("First string",f_s); + }; + +private: + int f_i = 3; + double f_d = 7.7; + bool f_b = true; + std::string f_s = "hello"; +}; + +class SecondClass : public ParameterAcceptor +{ +public: + SecondClass(const std::string &name = "Second Class"): + ParameterAcceptor(name) + { + add_parameter("Second int", s_i); + add_parameter("Second double",s_d); + add_parameter("Second bool", s_b); + add_parameter("Second string",s_s); + }; + +private: + int s_i = 5; + double s_d = 9.9; + bool s_b = false; + std::string s_s = "bye bye"; +}; + +int main () +{ + initlog(); + + FirstClass f; + SecondClass s; + std::string output_name = "used_parameter_acceptor_06.tex"; + ParameterAcceptor::initialize(SOURCE_DIR "/parameter_acceptor_parameters/parameter_acceptor_05.prm", output_name); + ParameterAcceptor::prm.log_parameters(deallog); + std::ifstream file (output_name.c_str()); + + std::string str; + deallog << "reading " << output_name << std::endl; + while (std::getline(file, str)) + deallog << str << std::endl; + + +} diff --git a/tests/parameter_handler/parameter_acceptor_06.output b/tests/parameter_handler/parameter_acceptor_06.output new file mode 100644 index 0000000000..a29b7b4d54 --- /dev/null +++ b/tests/parameter_handler/parameter_acceptor_06.output @@ -0,0 +1,130 @@ + +DEAL:parameters:First Class::First bool: true +DEAL:parameters:First Class::First double: 7.7 +DEAL:parameters:First Class::First int: 3 +DEAL:parameters:First Class::First string: hello +DEAL:parameters:Second Class::Second bool: false +DEAL:parameters:Second Class::Second double: 9.9 +DEAL:parameters:Second Class::Second int: 5 +DEAL:parameters:Second Class::Second string: bye bye +DEAL::reading used_parameter_acceptor_06.tex +DEAL::\subsection{Global parameters} +DEAL::\label{parameters:global} +DEAL:: +DEAL:: +DEAL:: +DEAL::\subsection{Parameters in section \tt First Class} +DEAL::\label{parameters:First_20Class} +DEAL:: +DEAL::\begin{itemize} +DEAL::\item {\it Parameter name:} {\tt First bool} +DEAL::\phantomsection\label{parameters:First Class/First bool} +DEAL:: +DEAL:: +DEAL::\index[prmindex]{First bool} +DEAL::\index[prmindexfull]{First Class!First bool} +DEAL::{\it Value:} true +DEAL:: +DEAL:: +DEAL::{\it Default:} true +DEAL:: +DEAL:: +DEAL::{\it Possible values:} A boolean value (true or false) +DEAL::\item {\it Parameter name:} {\tt First double} +DEAL::\phantomsection\label{parameters:First Class/First double} +DEAL:: +DEAL:: +DEAL::\index[prmindex]{First double} +DEAL::\index[prmindexfull]{First Class!First double} +DEAL::{\it Value:} 7.7 +DEAL:: +DEAL:: +DEAL::{\it Default:} 7.700000 +DEAL:: +DEAL:: +DEAL::{\it Possible values:} A floating point number $v$ such that $-\text{MAX\_DOUBLE} \leq v \leq \text{MAX\_DOUBLE}$ +DEAL::\item {\it Parameter name:} {\tt First int} +DEAL::\phantomsection\label{parameters:First Class/First int} +DEAL:: +DEAL:: +DEAL::\index[prmindex]{First int} +DEAL::\index[prmindexfull]{First Class!First int} +DEAL::{\it Value:} 3 +DEAL:: +DEAL:: +DEAL::{\it Default:} 3 +DEAL:: +DEAL:: +DEAL::{\it Possible values:} An integer $n$ such that $-2147483648\leq n \leq 2147483647$ +DEAL::\item {\it Parameter name:} {\tt First string} +DEAL::\phantomsection\label{parameters:First Class/First string} +DEAL:: +DEAL:: +DEAL::\index[prmindex]{First string} +DEAL::\index[prmindexfull]{First Class!First string} +DEAL::{\it Value:} hello +DEAL:: +DEAL:: +DEAL::{\it Default:} hello +DEAL:: +DEAL:: +DEAL::{\it Possible values:} Any string +DEAL::\end{itemize} +DEAL:: +DEAL::\subsection{Parameters in section \tt Second Class} +DEAL::\label{parameters:Second_20Class} +DEAL:: +DEAL::\begin{itemize} +DEAL::\item {\it Parameter name:} {\tt Second bool} +DEAL::\phantomsection\label{parameters:Second Class/Second bool} +DEAL:: +DEAL:: +DEAL::\index[prmindex]{Second bool} +DEAL::\index[prmindexfull]{Second Class!Second bool} +DEAL::{\it Value:} false +DEAL:: +DEAL:: +DEAL::{\it Default:} false +DEAL:: +DEAL:: +DEAL::{\it Possible values:} A boolean value (true or false) +DEAL::\item {\it Parameter name:} {\tt Second double} +DEAL::\phantomsection\label{parameters:Second Class/Second double} +DEAL:: +DEAL:: +DEAL::\index[prmindex]{Second double} +DEAL::\index[prmindexfull]{Second Class!Second double} +DEAL::{\it Value:} 9.9 +DEAL:: +DEAL:: +DEAL::{\it Default:} 9.900000 +DEAL:: +DEAL:: +DEAL::{\it Possible values:} A floating point number $v$ such that $-\text{MAX\_DOUBLE} \leq v \leq \text{MAX\_DOUBLE}$ +DEAL::\item {\it Parameter name:} {\tt Second int} +DEAL::\phantomsection\label{parameters:Second Class/Second int} +DEAL:: +DEAL:: +DEAL::\index[prmindex]{Second int} +DEAL::\index[prmindexfull]{Second Class!Second int} +DEAL::{\it Value:} 5 +DEAL:: +DEAL:: +DEAL::{\it Default:} 5 +DEAL:: +DEAL:: +DEAL::{\it Possible values:} An integer $n$ such that $-2147483648\leq n \leq 2147483647$ +DEAL::\item {\it Parameter name:} {\tt Second string} +DEAL::\phantomsection\label{parameters:Second Class/Second string} +DEAL:: +DEAL:: +DEAL::\index[prmindex]{Second string} +DEAL::\index[prmindexfull]{Second Class!Second string} +DEAL::{\it Value:} bye bye +DEAL:: +DEAL:: +DEAL::{\it Default:} bye bye +DEAL:: +DEAL:: +DEAL::{\it Possible values:} Any string +DEAL::\end{itemize}