ddt 1.2.1
Loading...
Searching...
No Matches
Classes | Functions | Variables
testCommandLineParser.cpp File Reference
#include <gtest/gtest.h>
#include <array>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/format.hpp>
#include "ddt/commandLineParser.hpp"

Classes

class  CommandLineParserSpy
 
class  CommandLineParserTest
 
class  CommandLineParserHelpTest
 
class  CommandLineParserViewerTest
 
class  CommandLineParserSubscriberTest
 
class  CommandLineParserPublisherTest
 

Functions

void splitString (string input, vector< char * > &v)
 
 TEST_F (CommandLineParserTest, setOptionsViewer)
 
 TEST_F (CommandLineParserTest, setOptionsSub)
 
 TEST_F (CommandLineParserTest, setOptionsPubTwo)
 
 TEST_F (CommandLineParserViewerTest, ParseViewer)
 Test the parsing of the help option.
 
 TEST_F (CommandLineParserViewerTest, ParseViewerFileName)
 
 TEST_F (CommandLineParserViewerTest, ParseViewerStream)
 
 TEST (CommandLineParserTestUtility, TestSplitString)
 
int main (int argc, char **argv)
 
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST (CommandLineParserHelpTest)
 
 INSTANTIATE_TEST_SUITE_P (ShowHelpTests, CommandLineParserHelpTest, ::testing::Values(h0, h1, h2))
 
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST (CommandLineParserSubscriberTest)
 
 INSTANTIATE_TEST_SUITE_P (ParseSubscriberTests, CommandLineParserSubscriberTest, ::testing::Values(sv0, sv1, sv2))
 
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST (CommandLineParserPublisherTest)
 
 INSTANTIATE_TEST_SUITE_P (ParsePublisherTests, CommandLineParserPublisherTest, ::testing::Values(p0, p1, p2))
 

Variables

string h0 = "test -h"
 
string h1 = "test --help"
 
string h2 = "test -h -s stream"
 
string sv0
 
string sv1 = "test --broker %1% -s %2% -v %3% -r %4% -a %5%"
 
string sv2 = "test --statistics %5% %1% %2% %3% %4%"
 
string p0
 
string p1 = "test -b %1% -s %2% -v %3% -u %4% -i %5% -m %6% -c %7%"
 
string p2 = "test --checksum %7% %1% %2% %3% %4% %5% %6%"
 

Function Documentation

◆ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST() [1/3]

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST ( CommandLineParserHelpTest )

◆ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST() [2/3]

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST ( CommandLineParserPublisherTest )

◆ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST() [3/3]

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST ( CommandLineParserSubscriberTest )

◆ INSTANTIATE_TEST_SUITE_P() [1/3]

INSTANTIATE_TEST_SUITE_P ( ParsePublisherTests ,
CommandLineParserPublisherTest ,
::testing::Values(p0, p1, p2)  )

◆ INSTANTIATE_TEST_SUITE_P() [2/3]

INSTANTIATE_TEST_SUITE_P ( ParseSubscriberTests ,
CommandLineParserSubscriberTest ,
::testing::Values(sv0, sv1, sv2)  )

◆ INSTANTIATE_TEST_SUITE_P() [3/3]

INSTANTIATE_TEST_SUITE_P ( ShowHelpTests ,
CommandLineParserHelpTest ,
::testing::Values(h0, h1, h2)  )

◆ main()

int main ( int argc,
char ** argv )

◆ splitString()

void splitString ( string input,
vector< char * > & v )

◆ TEST()

TEST ( CommandLineParserTestUtility ,
TestSplitString  )

◆ TEST_F() [1/6]

TEST_F ( CommandLineParserTest ,
setOptionsPubTwo  )

◆ TEST_F() [2/6]

TEST_F ( CommandLineParserTest ,
setOptionsSub  )

◆ TEST_F() [3/6]

TEST_F ( CommandLineParserTest ,
setOptionsViewer  )

◆ TEST_F() [4/6]

TEST_F ( CommandLineParserViewerTest ,
ParseViewer  )

Test the parsing of the help option.

This test verifies that -h and –help print the help to stdout.

◆ TEST_F() [5/6]

TEST_F ( CommandLineParserViewerTest ,
ParseViewerFileName  )

◆ TEST_F() [6/6]

TEST_F ( CommandLineParserViewerTest ,
ParseViewerStream  )

Variable Documentation

◆ h0

string h0 = "test -h"

◆ h1

string h1 = "test --help"

◆ h2

string h2 = "test -h -s stream"

◆ p0

string p0
Initial value:
=
"test --broker %1% --datastream %2% --interval %3% --buffer_size %4% "
"--image_folder %5% --mode %6% --checksum %7%"

◆ p1

string p1 = "test -b %1% -s %2% -v %3% -u %4% -i %5% -m %6% -c %7%"

◆ p2

string p2 = "test --checksum %7% %1% %2% %3% %4% %5% %6%"

◆ sv0

string sv0
Initial value:
=
"test --broker %1% --datastream %2% --interval %3% --remote %4% "
"--statistics %5%"

◆ sv1

string sv1 = "test --broker %1% -s %2% -v %3% -r %4% -a %5%"

◆ sv2

string sv2 = "test --statistics %5% %1% %2% %3% %4%"