AutoworkLogger๏ƒ

Experimental: Some methods may not be implemented and may be changed in future versions.

Inherits: RefCounted < Object

Handles logging and reporting of test results.

Description๏ƒ

The AutoworkLogger is responsible for collecting, formatting, and exporting test results produced by the Autowork framework.

It records passes, failures, and warnings during test execution and keeps track of statistics such as total tests and orphaned objects.

The logger can output results to the console as well as export them to structured formats like JSON and JUnit XML for integration with external tools and CI pipelines.

Methods๏ƒ

void

add_fail(message: String)

void

add_pass(message: String)

void

add_warning(message: String)

bool

export_json(file_path: String)

bool

export_xml(file_path: String)

void

inc_orphans(count: int)

void

inc_test_count()

void

print_summary()


Method Descriptions๏ƒ

void add_fail(message: String) ๐Ÿ”—

Records a failed assertion or test.

The provided message typically describes the reason for the failure and is stored for reporting and output.


void add_pass(message: String) ๐Ÿ”—

Records a successful assertion or test.

The provided message may contain additional context or confirmation of the passing condition.


void add_warning(message: String) ๐Ÿ”—

Records a warning generated during test execution.

Warnings do not cause a test to fail but indicate potential issues or unexpected conditions.


bool export_json(file_path: String) ๐Ÿ”—

Exports the collected test results to a JSON file.

The file at file_path will contain a structured representation of all logged results and statistics.

Returns true if the export succeeds, otherwise false.


bool export_xml(file_path: String) ๐Ÿ”—

Exports the collected test results in JUnit XML format.

The generated file can be used by continuous integration systems and reporting tools.

Returns true if the export succeeds, otherwise false.


void inc_orphans(count: int) ๐Ÿ”—

Increments the number of orphaned objects detected during testing.

Orphans typically refer to objects that were not properly freed or cleaned up, which may indicate memory management issues.


void inc_test_count() ๐Ÿ”—

Increments the total number of executed tests.

This is usually called internally as each test case begins or completes.


void print_summary() ๐Ÿ”—

Prints a summary of the test results.

The summary typically includes counts of passed, failed, and pending tests, along with warnings and other relevant statistics.