Chebyshev
Unit testing for scientific software
chebyshev::output::format Namespace Reference

Output formatting functions. More...

Functions

OutputFormat barebone ()
 Bare bone output format which just prints the result table as is, without any formatting beyond adjusting column width.
 
OutputFormat simple ()
 Simple output format which prints the fields separated by the separator string and padding, if enabled. More...
 
OutputFormat fancy (bool adaptiveWidth=true)
 Fancy output format which uses Unicode characters to print a continuous outline around the table. More...
 
OutputFormat csv (const std::string &separator=",")
 Format function for CSV format files. More...
 
OutputFormat markdown ()
 Format the table as Markdown. More...
 
OutputFormat latex ()
 Format the table as a LaTeX table in the tabular environment. More...
 

Detailed Description

Output formatting functions.

Output formats are handled by a lambda or function with the signature of OutputFormat. An output format is a function which takes in a matrix of strings which contains all entries of the table resulting from tests, the list of the fields printed in each respective column and the global settings of the output module (which contains the options for formatting and other settings). The output format may be fully customized, but many options are already available in this namespace. The output format is returned by each function (functions are used to construct a format taking custom options).

Function Documentation

◆ csv()

OutputFormat chebyshev::output::format::csv ( const std::string &  separator = ",")
inline

Format function for CSV format files.

The OutputFormat is returned as a lambda function.

Parameters
separatorThe string to print between different fields (defaults to ",").

◆ fancy()

OutputFormat chebyshev::output::format::fancy ( bool  adaptiveWidth = true)
inline

Fancy output format which uses Unicode characters to print a continuous outline around the table.

The OutputFormat is returned as a lambda function.

◆ latex()

OutputFormat chebyshev::output::format::latex ( )
inline

Format the table as a LaTeX table in the tabular environment.

The OutputFormat is returned as a lambda function.

◆ markdown()

OutputFormat chebyshev::output::format::markdown ( )
inline

Format the table as Markdown.

The OutputFormat is returned as a lambda function.

◆ simple()

OutputFormat chebyshev::output::format::simple ( )
inline

Simple output format which prints the fields separated by the separator string and padding, if enabled.

The OutputFormat is returned as a lambda function. This format is a good starting point if you want to implement your own custom output format.