KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KI_TEST::UTILITY_PROGRAM Struct Reference

Description of a "utility program", which is a program that takes some command line and does "something". More...

#include <utility_program.h>

Public Types

using FUNC = std::function< int(int argc, char **argv)>
 A function that provides the program for a given command line.
 

Public Member Functions

 UTILITY_PROGRAM (const std::string &aName, const std::string &aDesc, FUNC aMainFunc)
 
 UTILITY_PROGRAM ()
 

Public Attributes

std::string m_name
 The name of the program (this is used to select one)
 
std::string m_desc
 Description of the program.
 
FUNC m_func
 The function to call to run the program.
 

Detailed Description

Description of a "utility program", which is a program that takes some command line and does "something".

Likely uses of this are:

  • Test programs and demos
  • Benchmarks
  • Fuzz targets

This structure allows a single executable to select a program from many registered programs to avoid having to maintain "N" similar CMake scripts and perform "N" linkages.

Definition at line 68 of file utility_program.h.

Member Typedef Documentation

◆ FUNC

using KI_TEST::UTILITY_PROGRAM::FUNC = std::function<int( int argc, char** argv )>

A function that provides the program for a given command line.

Definition at line 71 of file utility_program.h.

Constructor & Destructor Documentation

◆ UTILITY_PROGRAM() [1/2]

KI_TEST::UTILITY_PROGRAM::UTILITY_PROGRAM ( const std::string &  aName,
const std::string &  aDesc,
FUNC  aMainFunc 
)
inline

Definition at line 73 of file utility_program.h.

◆ UTILITY_PROGRAM() [2/2]

KI_TEST::UTILITY_PROGRAM::UTILITY_PROGRAM ( )
inline

Definition at line 78 of file utility_program.h.

Member Data Documentation

◆ m_desc

std::string KI_TEST::UTILITY_PROGRAM::m_desc

Description of the program.

Definition at line 86 of file utility_program.h.

Referenced by KI_TEST::COMBINED_UTILITY::showSubUtilityList().

◆ m_func

FUNC KI_TEST::UTILITY_PROGRAM::m_func

The function to call to run the program.

Definition at line 89 of file utility_program.h.

Referenced by KI_TEST::COMBINED_UTILITY::findSubUtility().

◆ m_name

std::string KI_TEST::UTILITY_PROGRAM::m_name

The name of the program (this is used to select one)

Definition at line 83 of file utility_program.h.

Referenced by UTILITY_REGISTRY::Register(), and KI_TEST::COMBINED_UTILITY::showSubUtilityList().


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