valFuzz 1.2.0
Loading...
Searching...
No Matches
valfuzz Namespace Reference

Data Structures

class  csv_reporter
 
class  default_reporter
 
class  none_reporter
 
struct  report
 
class  reporter
 
class  reporter_engine
 

Typedefs

typedef std::function< void(std::string)> benchmark_function
 
typedef std::pair< std::string, benchmark_functionbenchmark_pair
 
typedef std::function< void(std::string)> test_function
 
typedef std::pair< std::string, test_functiontest_pair
 
typedef std::function< void(std::string)> fuzz_function
 
typedef std::pair< std::string, fuzz_functionfuzz_pair
 

Functions

unsigned long get_cache_l3_size ()
 
bool & get_do_benchmarks ()
 
int & get_num_iterations_benchmark ()
 
bool & get_run_one_benchmark ()
 
std::string & get_one_benchmark ()
 
unsigned long get_num_benchmarks ()
 
std::deque< benchmark_pair > & get_benchmarks ()
 
std::atomic< bool > & get_save_to_file ()
 
std::ofstream & get_save_file ()
 
void set_save_to_file (bool save_to_file)
 
void set_save_file (const std::filesystem::path &save_to_file_path)
 
void add_benchmark (const std::string &name, benchmark_function benchmark)
 
void set_do_benchmarks (bool do_benchmarks)
 
void set_num_iterations_benchmark (int num_iterations_benchmark)
 
void set_run_one_benchmark (bool run_one_benchmark)
 
void set_one_benchmark (const std::string &one_benchmark)
 
void run_benchmarks ()
 
std::mutex & get_stream_mutex ()
 
std::atomic< bool > & get_verbose ()
 
std::atomic< long unsigned int > & get_max_num_threads ()
 
std::mutex & get_tests_mutex ()
 
std::atomic< bool > & get_is_threaded ()
 
std::vector< std::thread > & get_thread_pool ()
 
template<typename T >
get_random ()
 
std::deque< fuzz_pair > & get_fuzzs ()
 
long unsigned int get_num_fuzz_tests ()
 
std::atomic< long unsigned int > & get_iterations ()
 
std::mt19937 & get_random_engine ()
 
std::uniform_real_distribution & get_uniform_distribution ()
 
void increment_iterations ()
 
std::optional< fuzz_pairpop_fuzz_or_null ()
 
void add_fuzz_test (const std::string &name, fuzz_function test)
 
void run_one_fuzz (const std::string &name)
 
void _run_fuzz_tests ()
 
void run_fuzz_tests ()
 
std::string & get_reporter ()
 
void set_reporter (std::string rep)
 
std::deque< valfuzz::test_pair > & get_tests ()
 
std::mutex & get_test_mutex ()
 
long unsigned int get_num_tests ()
 
std::atomic< bool > & get_has_failed_once ()
 
std::function< void()> & get_function_execute_before ()
 
std::function< void()> & get_function_execute_after ()
 
void set_function_execute_before (std::function< void()> f)
 
void set_function_execute_after (std::function< void()> f)
 
void set_has_failed_once (bool has_failed_once)
 
void add_test (const std::string &name, test_function test)
 
std::optional< valfuzz::test_pairpop_test_or_null ()
 
void run_one_test (const std::string &name)
 
void _run_tests ()
 
void run_tests ()
 
std::atomic< bool > & get_header ()
 
std::atomic< bool > & get_do_fuzzing ()
 
std::optional< std::string > & get_test_one ()
 
std::optional< std::string > & get_fuzz_one ()
 
void set_multithreaded (bool is_threaded)
 
void set_max_num_threads (long unsigned int max_num_threads)
 
void set_verbose (bool verbose)
 
void set_header (bool header)
 
void set_do_fuzzing (bool do_fuzzing)
 
void set_test_one (const std::string &test_one)
 
void set_fuzz_one (const std::string &fuzz_one)
 
void parse_args (int argc, char *argv[])
 
void print_header ()
 
int main (int argc, char **argv)
 
template<>
 __attribute__ ((noinline)) int get_random< int >()
 
template<>
float get_random< float > ()
 
template<>
double get_random< double > ()
 
template<>
char get_random< char > ()
 
template<>
bool get_random< bool > ()
 
template<>
std::string get_random< std::string > ()
 
 ADD_REPORTER (default_reporter)
 
 ADD_REPORTER (csv_reporter)
 
 ADD_REPORTER (none_reporter)
 
std::atomic< long unsigned int > & get_seed ()
 
void set_seed (long unsigned int new_seed)
 

Variables

reporter_engine reporter_eg
 
char valfuzz_banner []
 

Typedef Documentation

◆ benchmark_function

typedef std::function<void(std::string)> valfuzz::benchmark_function

Definition at line 98 of file benchmark.hpp.

◆ benchmark_pair

typedef std::pair<std::string, benchmark_function> valfuzz::benchmark_pair

Definition at line 99 of file benchmark.hpp.

◆ fuzz_function

typedef std::function<void(std::string)> valfuzz::fuzz_function

Definition at line 42 of file fuzz.hpp.

◆ fuzz_pair

typedef std::pair<std::string, fuzz_function> valfuzz::fuzz_pair

Definition at line 43 of file fuzz.hpp.

◆ test_function

typedef std::function<void(std::string)> valfuzz::test_function

Definition at line 18 of file common.hpp.

◆ test_pair

typedef std::pair<std::string, test_function> valfuzz::test_pair

Definition at line 19 of file common.hpp.

Function Documentation

◆ __attribute__()

template<>
valfuzz::__attribute__ ( (noinline) )

Definition at line 23 of file fuzz.cpp.

◆ _run_fuzz_tests()

void valfuzz::_run_fuzz_tests ( )

Definition at line 144 of file fuzz.cpp.

◆ _run_tests()

void valfuzz::_run_tests ( )

Definition at line 110 of file test.cpp.

◆ add_benchmark()

void valfuzz::add_benchmark ( const std::string & name,
benchmark_function benchmark )

Definition at line 132 of file benchmark.cpp.

◆ add_fuzz_test()

void valfuzz::add_fuzz_test ( const std::string & name,
fuzz_function test )

Definition at line 108 of file fuzz.cpp.

◆ ADD_REPORTER() [1/3]

valfuzz::ADD_REPORTER ( csv_reporter )

◆ ADD_REPORTER() [2/3]

valfuzz::ADD_REPORTER ( default_reporter )

◆ ADD_REPORTER() [3/3]

valfuzz::ADD_REPORTER ( none_reporter )

◆ add_test()

void valfuzz::add_test ( const std::string & name,
test_function test )

Definition at line 63 of file test.cpp.

◆ get_benchmarks()

std::deque< benchmark_pair > & valfuzz::get_benchmarks ( )

Definition at line 71 of file benchmark.cpp.

◆ get_cache_l3_size()

unsigned long valfuzz::get_cache_l3_size ( )

Definition at line 56 of file benchmark.cpp.

◆ get_do_benchmarks()

bool & valfuzz::get_do_benchmarks ( )

Definition at line 62 of file benchmark.cpp.

◆ get_do_fuzzing()

std::atomic< bool > & valfuzz::get_do_fuzzing ( )

Definition at line 22 of file valfuzz.cpp.

◆ get_function_execute_after()

std::function< void()> & valfuzz::get_function_execute_after ( )

Definition at line 39 of file test.cpp.

◆ get_function_execute_before()

std::function< void()> & valfuzz::get_function_execute_before ( )

Definition at line 33 of file test.cpp.

◆ get_fuzz_one()

std::optional< std::string > & valfuzz::get_fuzz_one ( )

Definition at line 42 of file valfuzz.cpp.

◆ get_fuzzs()

std::deque< fuzz_pair > & valfuzz::get_fuzzs ( )

Definition at line 65 of file fuzz.cpp.

◆ get_has_failed_once()

std::atomic< bool > & valfuzz::get_has_failed_once ( )

Definition at line 23 of file test.cpp.

◆ get_header()

std::atomic< bool > & valfuzz::get_header ( )

Definition at line 12 of file valfuzz.cpp.

◆ get_is_threaded()

std::atomic< bool > & valfuzz::get_is_threaded ( )

Definition at line 49 of file common.cpp.

◆ get_iterations()

std::atomic< long unsigned int > & valfuzz::get_iterations ( )

Definition at line 77 of file fuzz.cpp.

◆ get_max_num_threads()

std::atomic< long unsigned int > & valfuzz::get_max_num_threads ( )

Definition at line 30 of file common.cpp.

◆ get_num_benchmarks()

unsigned long valfuzz::get_num_benchmarks ( )

Definition at line 86 of file benchmark.cpp.

◆ get_num_fuzz_tests()

long unsigned int valfuzz::get_num_fuzz_tests ( )

Definition at line 71 of file fuzz.cpp.

◆ get_num_iterations_benchmark()

int & valfuzz::get_num_iterations_benchmark ( )

Definition at line 77 of file benchmark.cpp.

◆ get_num_tests()

long unsigned int valfuzz::get_num_tests ( )

Definition at line 17 of file test.cpp.

◆ get_one_benchmark()

std::string & valfuzz::get_one_benchmark ( )

Definition at line 101 of file benchmark.cpp.

◆ get_random()

template<typename T >
T valfuzz::get_random ( )

◆ get_random< bool >()

template<>
bool valfuzz::get_random< bool > ( )

Definition at line 49 of file fuzz.cpp.

◆ get_random< char >()

template<>
char valfuzz::get_random< char > ( )

Definition at line 44 of file fuzz.cpp.

◆ get_random< double >()

template<>
double valfuzz::get_random< double > ( )

Definition at line 36 of file fuzz.cpp.

◆ get_random< float >()

template<>
float valfuzz::get_random< float > ( )

Definition at line 28 of file fuzz.cpp.

◆ get_random< std::string >()

template<>
std::string valfuzz::get_random< std::string > ( )

Definition at line 54 of file fuzz.cpp.

◆ get_random_engine()

std::mt19937 & valfuzz::get_random_engine ( )

Definition at line 11 of file fuzz.cpp.

◆ get_reporter()

std::string & valfuzz::get_reporter ( )

Definition at line 20 of file reporter.cpp.

◆ get_run_one_benchmark()

bool & valfuzz::get_run_one_benchmark ( )

Definition at line 92 of file benchmark.cpp.

◆ get_save_file()

std::ofstream & valfuzz::get_save_file ( )

Definition at line 107 of file benchmark.cpp.

◆ get_save_to_file()

std::atomic< bool > & valfuzz::get_save_to_file ( )

Definition at line 11 of file benchmark.cpp.

◆ get_seed()

std::atomic< long unsigned int > & valfuzz::get_seed ( )

Definition at line 52 of file valfuzz.cpp.

◆ get_stream_mutex()

std::mutex & valfuzz::get_stream_mutex ( )

Definition at line 11 of file common.cpp.

◆ get_test_mutex()

std::mutex & valfuzz::get_test_mutex ( )

◆ get_test_one()

std::optional< std::string > & valfuzz::get_test_one ( )

Definition at line 32 of file valfuzz.cpp.

◆ get_tests()

std::deque< valfuzz::test_pair > & valfuzz::get_tests ( )

Definition at line 11 of file test.cpp.

◆ get_tests_mutex()

std::mutex & valfuzz::get_tests_mutex ( )

Definition at line 40 of file common.cpp.

◆ get_thread_pool()

std::vector< std::thread > & valfuzz::get_thread_pool ( )

Definition at line 59 of file common.cpp.

◆ get_uniform_distribution()

std::uniform_real_distribution & valfuzz::get_uniform_distribution ( )

Definition at line 17 of file fuzz.cpp.

◆ get_verbose()

std::atomic< bool > & valfuzz::get_verbose ( )

Definition at line 20 of file common.cpp.

◆ increment_iterations()

void valfuzz::increment_iterations ( )

Definition at line 87 of file fuzz.cpp.

◆ main()

int valfuzz::main ( int argc,
char ** argv )

Definition at line 316 of file valfuzz.cpp.

◆ parse_args()

void valfuzz::parse_args ( int argc,
char * argv[] )

Definition at line 135 of file valfuzz.cpp.

◆ pop_fuzz_or_null()

std::optional< fuzz_pair > valfuzz::pop_fuzz_or_null ( )

Definition at line 93 of file fuzz.cpp.

◆ pop_test_or_null()

std::optional< valfuzz::test_pair > valfuzz::pop_test_or_null ( )

Definition at line 70 of file test.cpp.

◆ print_header()

void valfuzz::print_header ( )

Definition at line 115 of file valfuzz.cpp.

◆ run_benchmarks()

void valfuzz::run_benchmarks ( )

Definition at line 162 of file benchmark.cpp.

◆ run_fuzz_tests()

void valfuzz::run_fuzz_tests ( )

Definition at line 168 of file fuzz.cpp.

◆ run_one_fuzz()

void valfuzz::run_one_fuzz ( const std::string & name)

Definition at line 115 of file fuzz.cpp.

◆ run_one_test()

void valfuzz::run_one_test ( const std::string & name)

Definition at line 85 of file test.cpp.

◆ run_tests()

void valfuzz::run_tests ( )

Definition at line 125 of file test.cpp.

◆ set_do_benchmarks()

void valfuzz::set_do_benchmarks ( bool do_benchmarks)

Definition at line 138 of file benchmark.cpp.

◆ set_do_fuzzing()

void valfuzz::set_do_fuzzing ( bool do_fuzzing)

Definition at line 83 of file valfuzz.cpp.

◆ set_function_execute_after()

void valfuzz::set_function_execute_after ( std::function< void()> f)

Definition at line 51 of file test.cpp.

◆ set_function_execute_before()

void valfuzz::set_function_execute_before ( std::function< void()> f)

Definition at line 45 of file test.cpp.

◆ set_fuzz_one()

void valfuzz::set_fuzz_one ( const std::string & fuzz_one)

Definition at line 95 of file valfuzz.cpp.

◆ set_has_failed_once()

void valfuzz::set_has_failed_once ( bool has_failed_once)

Definition at line 57 of file test.cpp.

◆ set_header()

void valfuzz::set_header ( bool header)

Definition at line 77 of file valfuzz.cpp.

◆ set_max_num_threads()

void valfuzz::set_max_num_threads ( long unsigned int max_num_threads)

Definition at line 65 of file valfuzz.cpp.

◆ set_multithreaded()

void valfuzz::set_multithreaded ( bool is_threaded)

Definition at line 59 of file valfuzz.cpp.

◆ set_num_iterations_benchmark()

void valfuzz::set_num_iterations_benchmark ( int num_iterations_benchmark)

Definition at line 144 of file benchmark.cpp.

◆ set_one_benchmark()

void valfuzz::set_one_benchmark ( const std::string & one_benchmark)

Definition at line 156 of file benchmark.cpp.

◆ set_reporter()

void valfuzz::set_reporter ( std::string rep)

Definition at line 26 of file reporter.cpp.

◆ set_run_one_benchmark()

void valfuzz::set_run_one_benchmark ( bool run_one_benchmark)

Definition at line 150 of file benchmark.cpp.

◆ set_save_file()

void valfuzz::set_save_file ( const std::filesystem::path & save_to_file_path)

Definition at line 119 of file benchmark.cpp.

◆ set_save_to_file()

void valfuzz::set_save_to_file ( bool save_to_file)

Definition at line 113 of file benchmark.cpp.

◆ set_seed()

void valfuzz::set_seed ( long unsigned int new_seed)

Definition at line 101 of file valfuzz.cpp.

◆ set_test_one()

void valfuzz::set_test_one ( const std::string & test_one)

Definition at line 89 of file valfuzz.cpp.

◆ set_verbose()

void valfuzz::set_verbose ( bool verbose)

Definition at line 71 of file valfuzz.cpp.

Variable Documentation

◆ reporter_eg

reporter_engine valfuzz::reporter_eg

Global reporter engine

Definition at line 10 of file reporter.cpp.

◆ valfuzz_banner

char valfuzz::valfuzz_banner[]
Initial value:
= " _ _____ \n"
" __ ____ _| | ___| _ ________\n"
" \\ \\ / / _` | | |_ | | | |_ /_ /\n"
" \\ V / (_| | | _|| |_| |/ / / / \n"
" \\_/ \\__,_|_|_| \\__,_/___/___|\n"
" \n"
"A modern testing & fuzzing library for C++\n"

Definition at line 107 of file valfuzz.cpp.