libabigail
Classes | Namespaces | Typedefs | Functions
test-read-common.h File Reference

This file declares the common functionality for tests in CTF and DWARF readers, it declares abstractions for `act` test stage. More...

#include <string>
#include "abg-ir.h"
#include "abg-corpus.h"
#include "abg-workers.h"
#include "abg-writer.h"
#include "test-utils.h"
#include "abg-tools-utils.h"
Include dependency graph for test-read-common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  InOutSpec
 This is an aggregate that specifies where a test shall get its input from, and where it shall write its output to. More...
 
struct  options
 An abstraction for valid test options. More...
 
struct  test_task
 The task that performs the tests. More...
 

Namespaces

 abigail
 Toplevel namespace for libabigail.
 

Typedefs

typedef test_task *(* create_new_test) (const InOutSpec *s, string &a_out_abi_base, string &a_in_elf_base, string &a_in_abi_base)
 A convenience typedef for a callback to create_new_test instances. More...
 
typedef shared_ptr< test_task > test_task_sptr
 

Functions

void display_usage (const string &prog_name, ostream &out)
 Write the usage message to out stream object. More...
 
bool parse_command_line (int argc, char *argv[], options &opts)
 Parse and process test options. More...
 
bool run_tests (const size_t num_tests, const InOutSpec *specs, const options &opts, create_new_test new_test)
 The main entry point to execute the testsuite. More...
 

Detailed Description

This file declares the common functionality for tests in CTF and DWARF readers, it declares abstractions for `act` test stage.

Definition in file test-read-common.h.

Typedef Documentation

◆ create_new_test

typedef test_task*(* create_new_test) (const InOutSpec *s, string &a_out_abi_base, string &a_in_elf_base, string &a_in_abi_base)

A convenience typedef for a callback to create_new_test instances.

Definition at line 172 of file test-read-common.h.

Function Documentation

◆ display_usage()

void display_usage ( const string &  prog_name,
ostream &  out 
)

Write the usage message to out stream object.

Parameters
prog_namethe program name.
outthe stream object to which want to write.

Definition at line 156 of file test-read-common.cc.

◆ parse_command_line()

bool parse_command_line ( int  argc,
char *  argv[],
options opts 
)

Parse and process test options.

Parameters
argcthe arguments number.
argvthe pointer to the arguments.
optsthe valid options to be processed/parsed.
Returns
true if options was processed/parsed successfully. It returns false when help is requested or an invalid option is supplied.

Definition at line 177 of file test-read-common.cc.

◆ run_tests()

bool run_tests ( const size_t  num_tests,
const InOutSpec specs,
const options opts,
create_new_test  new_test 
)

The main entry point to execute the testsuite.

Parameters
num_teststhe number of tests to be executed.
specsthe abigail::tests::read_common::InOutSpec tests container.
optsthe test execution abigail::tests::read_common::options.
new_testthe create_new_test callback function to create a new test task object.
Returns
true if `all` tests were performed successfully. Otherwise false is returned.

Definition at line 212 of file test-read-common.cc.