C++ Utilities: ArgumentParserTests Class Reference

C++ Utilities 5.34.2 Useful C++ classes and routines such as argument parser, IO and conversion utilities

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ArgumentParserTests Class Reference

The ArgumentParserTests class tests the ArgumentParser and Argument classes. More...

Inheritance diagram for ArgumentParserTests:
[legend]
Collaboration diagram for ArgumentParserTests:
[legend]

## Public Member Functions
void | setUp () override
void | tearDown () override
void | testArgument ()
| Tests the behaviour of the argument class.
void | testParsing ()
| Tests parsing command line arguments.
void | testCallbacks ()
| Tests whether callbacks are called correctly.
void | testSetMainArguments ()
| Tests some corner cases in setMainArguments() which are not already checked in the other tests.
void | testValueConversion ()
| Tests value conversion provided by Argument and ArgumentOccurrence.
void | testBashCompletion ()
| Tests bash completion.
void | testHelp ()
| Tests –help output.
void | testNoColorArgument ()
| Tests whether NocolorArgument toggles escape codes correctly.

## Detailed Description

The ArgumentParserTests class tests the ArgumentParser and Argument classes.

Definition at line 39 of file argumentparsertests.cpp.

## Member Function Documentation

## ◆ setUp()

void ArgumentParserTests::setUp | ( |  | ) |
| override

Definition at line 75 of file argumentparsertests.cpp.

## ◆ tearDown()

void ArgumentParserTests::tearDown | ( |  | ) |
| override

Definition at line 83 of file argumentparsertests.cpp.

## ◆ testArgument()

void ArgumentParserTests::testArgument | ( |  | ) |

Tests the behaviour of the argument class.

Definition at line 95 of file argumentparsertests.cpp.

## ◆ testBashCompletion()

void ArgumentParserTests::testBashCompletion | ( |  | ) |

Tests bash completion.

Remarks
  - Disabled under Windows because OutputCheck isn't working.
  - This tests makes assumptions about the order and the exact output format.

Definition at line 526 of file argumentparsertests.cpp.

## ◆ testCallbacks()

void ArgumentParserTests::testCallbacks | ( |  | ) |

Tests whether callbacks are called correctly.

Definition at line 482 of file argumentparsertests.cpp.

## ◆ testHelp()

void ArgumentParserTests::testHelp | ( |  | ) |

Tests –help output.

Remarks
  Disabled under Windows because OutputCheck isn't working.

Definition at line 781 of file argumentparsertests.cpp.

## ◆ testNoColorArgument()

void ArgumentParserTests::testNoColorArgument | ( |  | ) |

Tests whether NocolorArgument toggles escape codes correctly.

Remarks
  Disabled under Windows. Under that platform we could alter the environment using SetEnvironmentVariableW. However, that doesn't seem to have an effect on further getenv() or _wgetenv() calls.

Definition at line 916 of file argumentparsertests.cpp.

## ◆ testParsing()

void ArgumentParserTests::testParsing | ( |  | ) |

Tests parsing command line arguments.

Definition at line 120 of file argumentparsertests.cpp.

## ◆ testSetMainArguments()

void ArgumentParserTests::testSetMainArguments | ( |  | ) |

Tests some corner cases in setMainArguments() which are not already checked in the other tests.

Definition at line 890 of file argumentparsertests.cpp.

## ◆ testValueConversion()

void ArgumentParserTests::testValueConversion | ( |  | ) |

Tests value conversion provided by Argument and ArgumentOccurrence.

Definition at line 954 of file argumentparsertests.cpp.

The documentation for this class was generated from the following file:

- tests/argumentparsertests.cpp