UEFIStarter
a simple UEFI framework
Macros | Functions | Variables
output.c File Reference

Presentation logic for tests: generates output with verbosity level in mind. More...

#include <UEFIStarter/tests/output.h>
#include <UEFIStarter/tests/tests.h>

Macros

#define TRACE_STARTTYPE(NAME)
 helper macro for debugging output logic - the silent version is active, this won't do anything
 
#define TRACE_ENDTYPE(NAME)
 helper macro for debugging output logic - the silent version is active, this won't do anything
 

Functions

static void _print_optional_multiline_test_prefix_or (CHAR16 *or)
 Internal: prints either a suitable whitespace prefix if multiline output is enabled, or the given string if not. More...
 
void print_test_group_start (CHAR16 *name)
 Prints the start of a test group. More...
 
void print_test_group_end ()
 Prints the end of a test group.
 
void print_assert_counts (INT64 fails, INT64 asserts)
 Prints assertion counts, if enabled. More...
 
static void _print_outcome (test_outcome outcome)
 Internal: prints a test result status. More...
 
static void _print_1char_outcome (test_outcome outcome)
 Internal: prints a test result status, as 1 character. More...
 
void print_group_result (test_results_t *results)
 Prints a test group's results. More...
 
void print_individual_result (test_results_t *results)
 Prints an individual test's results. More...
 
void print_test_result_summary (test_results_t *results)
 Prints test result summary, if enabled. More...
 
void print_individual_test_start (CHAR16 *description)
 Prints the start of an indivual test, if enabled. More...
 
void print_assertion (BOOLEAN success, CHAR16 *description, CHAR16 *message)
 Prints an assertion's result. More...
 
void debug_print_verbosity ()
 Internal: prints verbosity settings.
 
void debug_print_results (test_results_t *results)
 Internal: prints raw test results. More...
 

Variables

test_verbosity_t test_verbosity
 the current test verbosity
 

Detailed Description

Presentation logic for tests: generates output with verbosity level in mind.

Author
Richard Nusser
License
GPLv3 (see http://www.gnu.org/licenses/)
See also
https://github.com/rinusser/UEFIStarter

Function Documentation

◆ _print_optional_multiline_test_prefix_or()

static void _print_optional_multiline_test_prefix_or ( CHAR16 *  or)
static

Internal: prints either a suitable whitespace prefix if multiline output is enabled, or the given string if not.

Parameters
orthe alternative string to print if multiline output is disabled, may be NULL

◆ print_test_group_start()

void print_test_group_start ( CHAR16 *  name)

Prints the start of a test group.

Parameters
namethe test group's name

◆ print_assert_counts()

void print_assert_counts ( INT64  fails,
INT64  asserts 
)

Prints assertion counts, if enabled.

Parameters
failsthe number of failed assertions
assertsthe total number of assertions

◆ _print_outcome()

static void _print_outcome ( test_outcome  outcome)
static

Internal: prints a test result status.

Parameters
outcomethe result to print

◆ _print_1char_outcome()

static void _print_1char_outcome ( test_outcome  outcome)
static

Internal: prints a test result status, as 1 character.

Parameters
outcomethe result to print

◆ print_group_result()

void print_group_result ( test_results_t results)

Prints a test group's results.

Parameters
resultsthe results to print

◆ print_individual_result()

void print_individual_result ( test_results_t results)

Prints an individual test's results.

Parameters
resultsthe results to print

◆ print_test_result_summary()

void print_test_result_summary ( test_results_t results)

Prints test result summary, if enabled.

Parameters
resultsthe results to summarize

◆ print_individual_test_start()

void print_individual_test_start ( CHAR16 *  description)

Prints the start of an indivual test, if enabled.

Parameters
descriptionthe test's description to print

◆ print_assertion()

void print_assertion ( BOOLEAN  success,
CHAR16 *  description,
CHAR16 *  message 
)

Prints an assertion's result.

Parameters
successwhether the assertion passed
descriptionthe assertion's description to print, if enabled
messagethe assertion's error message to print, if enabled

◆ debug_print_results()

void debug_print_results ( test_results_t results)

Internal: prints raw test results.

Parameters
resultsthe test results to output