fortplot_test_helpers Module

Unified secure test utilities module Provides comprehensive test file management with proper cleanup Replaces all previous test helper modules with secure implementation



Functions

public function test_get_unique_suffix() result(suffix)

Generate reliable unique suffix combining multiple entropy sources

Arguments

None

Return Value character(len=:), allocatable

public function test_get_temp_path(filename) result(full_path)

Get secure temporary file path with validation

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename

Return Value character(len=:), allocatable


Subroutines

public subroutine test_initialize_environment(test_name)

Initialize test environment with specific name

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: test_name

public subroutine test_register_file(filename)

Register a file for automatic cleanup

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename

public subroutine test_cleanup_file(filename)

Clean up a specific test file

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename

public subroutine test_initialize_figure(fig, width, height, backend)

Initialize figure for testing (ensures temp directory exists)

Arguments

Type IntentOptional Attributes Name
type(figure_t), intent(out) :: fig
integer, intent(in) :: width
integer, intent(in) :: height
character(len=*), intent(in) :: backend

public subroutine test_savefig(fig, filename)

Save figure to temporary directory with automatic registration

Arguments

Type IntentOptional Attributes Name
type(figure_t), intent(inout) :: fig
character(len=*), intent(in) :: filename

public subroutine test_cleanup_all()

Clean up all registered files and test directory securely

Arguments

None