The warning suppression system eliminates test output noise while preserving developer warnings during development. The system uses environment variables and automatic CI detection to control warning output behavior.
# Suppress all warnings
export FORTPLOT_SUPPRESS_WARNINGS=1
# Enable all warnings (default)
export FORTPLOT_SUPPRESS_WARNINGS=0
Supported Values: 1
, true
, yes
, on
(case-insensitive) enable suppression.
# Force warnings even in CI environments
export FORTPLOT_FORCE_WARNINGS=1
Forces warning output even when CI environment is detected. Useful for debugging CI issues.
The system automatically detects CI environments and suppresses warnings:
GITHUB_ACTIONS=true
CI=true
CONTINUOUS_INTEGRATION=true
or BUILD_ID
presentTRAVIS=true
CIRCLECI=true
FORTPLOT_SUPPRESS_WARNINGS
takes highest priorityFORTPLOT_FORCE_WARNINGS
overrides CI auto-detection# Normal development (warnings visible)
make test
# Clean output for focus
FORTPLOT_SUPPRESS_WARNINGS=1 make test
# CI automatically suppresses warnings
make test # Clean output in CI
# Debug CI issues with warnings
FORTPLOT_FORCE_WARNINGS=1 make test
# Test with CI-like clean output
export FORTPLOT_SUPPRESS_WARNINGS=1
make test
unset FORTPLOT_SUPPRESS_WARNINGS
# Test warning generation
export FORTPLOT_FORCE_WARNINGS=1
make test
unset FORTPLOT_FORCE_WARNINGS
fortplot_logging.f90
: Warning suppression infrastructurefortplot_figure_base.f90
: Subplot limit warningsfortplot_plotting.f90
: Plot count warningslog_warning()
for consistent behavior! Check if warnings should be output
if (.not. is_warnings_suppressed()) then
call log_warning("Performance warning: many subplots")
end if
# Test warning suppression functionality
make test ARGS="--target test_warning_suppression_control"
# Test CI environment detection
make test ARGS="--target test_ci_environment_warning_detection"
# Test warning generation
make test ARGS="--target test_subplot_warning_management"
# Verify warnings appear in development
make test 2>&1 | grep WARNING
# Verify warnings suppressed in CI mode
FORTPLOT_SUPPRESS_WARNINGS=1 make test 2>&1 | grep WARNING
# Should return empty
echo $FORTPLOT_SUPPRESS_WARNINGS
FORTPLOT_FORCE_WARNINGS=1
LOG_LEVEL_SILENT
echo $FORTPLOT_FORCE_WARNINGS
export FORTPLOT_SUPPRESS_WARNINGS=0
The warning suppression system has minimal performance impact: - Environment variables checked once during initialization - Boolean flag checks for each warning (negligible overhead) - No impact when warnings are suppressed