FreeNOS
Public Member Functions | Private Attributes | Static Private Attributes
DirectoryScanner Class Reference

Scan directory for automated tests. More...

#include <DirectoryScanner.h>

Public Member Functions

 DirectoryScanner (int argc, char **argv)
 Constructor. More...
 
 ~DirectoryScanner ()
 Destructor. More...
 
int scan (const char *path)
 Scan filesystem path for tests. More...
 

Private Attributes

int m_argc
 Program argument count. More...
 
char ** m_argv
 Program argument values. More...
 
Index< ExternalTest, MaximumExternalTestsm_externalTests
 External tests that are detected. More...
 

Static Private Attributes

static const Size MaximumExternalTests = 512u
 Maximum number of external tests. More...
 

Detailed Description

Scan directory for automated tests.

Definition at line 36 of file DirectoryScanner.h.

Constructor & Destructor Documentation

◆ DirectoryScanner()

DirectoryScanner::DirectoryScanner ( int  argc,
char **  argv 
)

Constructor.

Parameters
argcProgram argument count
argvProgram argument values

Definition at line 28 of file DirectoryScanner.cpp.

References m_argc, and m_argv.

◆ ~DirectoryScanner()

DirectoryScanner::~DirectoryScanner ( )

Destructor.

Definition at line 34 of file DirectoryScanner.cpp.

References Index< T, N >::deleteAll(), and m_externalTests.

Member Function Documentation

◆ scan()

int DirectoryScanner::scan ( const char *  path)

Scan filesystem path for tests.

Parameters
pathInput filesystem path
Returns
Zero on success, non-zero otherwise

Definition at line 39 of file DirectoryScanner.cpp.

References closedir(), dirent::d_name, dirent::d_type, DT_DIR, DT_REG, String::endsWith(), errno, EXIT_FAILURE, EXIT_SUCCESS, Index< T, N >::insert(), m_argc, m_argv, m_externalTests, opendir(), printf(), readdir(), snprintf(), and strerror().

Field Documentation

◆ m_argc

int DirectoryScanner::m_argc
private

Program argument count.

Definition at line 70 of file DirectoryScanner.h.

Referenced by DirectoryScanner(), and scan().

◆ m_argv

char** DirectoryScanner::m_argv
private

Program argument values.

Definition at line 73 of file DirectoryScanner.h.

Referenced by DirectoryScanner(), and scan().

◆ m_externalTests

Index<ExternalTest, MaximumExternalTests> DirectoryScanner::m_externalTests
private

External tests that are detected.

Definition at line 76 of file DirectoryScanner.h.

Referenced by scan(), and ~DirectoryScanner().

◆ MaximumExternalTests

const Size DirectoryScanner::MaximumExternalTests = 512u
staticprivate

Maximum number of external tests.

Definition at line 41 of file DirectoryScanner.h.


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