|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
C unit tests for runtime log-level, allow-list, conversion, and profiling helpers. More...
#include "test_support.h"#include "logging.h"#include "interpolation.h"#include <fcntl.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>Go to the source code of this file.
Data Structures | |
| struct | AnatomyCaptureCtx |
Typedefs | |
| typedef PetscErrorCode(* | CapturedLoggingFn) (UserCtx *user, SimCtx *simCtx, void *ctx) |
| typedef struct AnatomyCaptureCtx | AnatomyCaptureCtx |
Functions | |
| static PetscErrorCode | AssertFileContains (const char *path, const char *needle, const char *context) |
| Asserts that one text file contains a required substring. | |
| static PetscErrorCode | AssertFileNotContains (const char *path, const char *needle, const char *context) |
| Asserts that one text file does not contain an excluded substring. | |
| static PetscErrorCode | CaptureLoggingOutput (UserCtx *user, SimCtx *simCtx, CapturedLoggingFn fn, void *ctx, char *captured, size_t captured_len) |
| Captures stdout emitted by one logging helper into a temporary file-backed buffer. | |
| static PetscErrorCode | InvokeParticleFieldLog (UserCtx *user, SimCtx *simCtx, void *ctx) |
Adapts LOG_PARTICLE_FIELDS() to the generic stdout-capture callback shape. | |
| static PetscErrorCode | InvokeParticleConsoleSnapshot (UserCtx *user, SimCtx *simCtx, void *ctx) |
Adapts EmitParticleConsoleSnapshot() to the generic stdout-capture callback shape. | |
| static PetscErrorCode | InvokeFieldAnatomyLog (UserCtx *user, SimCtx *simCtx, void *ctx) |
Adapts LOG_FIELD_ANATOMY() to the generic stdout-capture callback shape. | |
| static PetscErrorCode | SeedLoggingParticleFixture (SimCtx **simCtx_out, UserCtx **user_out) |
| Creates a small particle-bearing runtime fixture used by logging tests. | |
| static PetscErrorCode | TestStringConversionHelpers (void) |
| Tests string-conversion helpers for configured enums and unknown values. | |
| static PetscErrorCode | TestGetLogLevelFromEnvironment (void) |
| Tests that log level selection honors the environment variable. | |
| static PetscErrorCode | TestAllowedFunctionsFilter (void) |
| Tests the function allow-list filter used by the logging layer. | |
| static PetscErrorCode | TestParticleConsoleSnapshotCadence (void) |
| Tests periodic particle console snapshot enablement and cadence. | |
| static PetscErrorCode | TestLoggingFileParsingAndFormattingHelpers (void) |
| Tests logging-side file parsing, helper formatting, and progress utilities. | |
| static PetscErrorCode | TestLoggingContinuityAndFieldDiagnostics (void) |
| Tests continuity, min/max, and anatomy logging helpers on minimal runtime fixtures. | |
| static PetscErrorCode | TestInterpolationErrorLogging (void) |
| Tests interpolation-error logging against an analytically matched particle field. | |
| static PetscErrorCode | TestScatterMetricsLogging (void) |
| Tests file-backed scatter metrics logging against a fully occupied constant field. | |
| static PetscErrorCode | TestParticleFieldTableLogging (void) |
| Tests stdout particle-table logging on a production-like swarm fixture. | |
| static PetscErrorCode | TestParticleConsoleSnapshotLogging (void) |
| Tests console snapshot logging against the public periodic-snapshot helper. | |
| static PetscErrorCode | TestParticleMetricsLogging (void) |
| Tests file-backed particle metrics logging after derived metrics are computed. | |
| static PetscErrorCode | TestSearchMetricsLogging (void) |
| Tests file-backed search metrics logging with the compact CSV contract. | |
| static PetscErrorCode | TestFieldAnatomyLogging (void) |
| Tests stdout field-anatomy logging on the corrected production-like DM fixture. | |
| static PetscErrorCode | TestProfilingLifecycleHelpers (void) |
| Tests profiling helper lifecycle logging for timestep and final-summary outputs. | |
| int | main (int argc, char **argv) |
| Runs the unit-logging PETSc test binary. | |
C unit tests for runtime log-level, allow-list, conversion, and profiling helpers.
Definition in file test_logging.c.
| struct AnatomyCaptureCtx |
Definition at line 109 of file test_logging.c.
| Data Fields | ||
|---|---|---|
| const char * | field_name | |
| const char * | stage_name | |
Definition at line 107 of file test_logging.c.
| typedef struct AnatomyCaptureCtx AnatomyCaptureCtx |
|
static |
Asserts that one text file contains a required substring.
Definition at line 20 of file test_logging.c.
|
static |
Asserts that one text file does not contain an excluded substring.
Definition at line 65 of file test_logging.c.
|
static |
Captures stdout emitted by one logging helper into a temporary file-backed buffer.
Definition at line 117 of file test_logging.c.
Adapts LOG_PARTICLE_FIELDS() to the generic stdout-capture callback shape.
Definition at line 168 of file test_logging.c.
|
static |
Adapts EmitParticleConsoleSnapshot() to the generic stdout-capture callback shape.
Definition at line 181 of file test_logging.c.
Adapts LOG_FIELD_ANATOMY() to the generic stdout-capture callback shape.
Definition at line 193 of file test_logging.c.
|
static |
Creates a small particle-bearing runtime fixture used by logging tests.
Definition at line 206 of file test_logging.c.
|
static |
Tests string-conversion helpers for configured enums and unknown values.
Definition at line 254 of file test_logging.c.
|
static |
Tests that log level selection honors the environment variable.
Definition at line 281 of file test_logging.c.
|
static |
Tests the function allow-list filter used by the logging layer.
Definition at line 293 of file test_logging.c.
|
static |
Tests periodic particle console snapshot enablement and cadence.
Definition at line 313 of file test_logging.c.
|
static |
Tests logging-side file parsing, helper formatting, and progress utilities.
Definition at line 340 of file test_logging.c.
|
static |
Tests continuity, min/max, and anatomy logging helpers on minimal runtime fixtures.
Definition at line 405 of file test_logging.c.
|
static |
Tests interpolation-error logging against an analytically matched particle field.
Definition at line 492 of file test_logging.c.
|
static |
Tests file-backed scatter metrics logging against a fully occupied constant field.
Definition at line 539 of file test_logging.c.
|
static |
Tests stdout particle-table logging on a production-like swarm fixture.
Definition at line 613 of file test_logging.c.
|
static |
Tests console snapshot logging against the public periodic-snapshot helper.
Definition at line 634 of file test_logging.c.
|
static |
Tests file-backed particle metrics logging after derived metrics are computed.
Definition at line 655 of file test_logging.c.
|
static |
Tests file-backed search metrics logging with the compact CSV contract.
Definition at line 691 of file test_logging.c.
|
static |
Tests stdout field-anatomy logging on the corrected production-like DM fixture.
Definition at line 742 of file test_logging.c.
|
static |
Tests profiling helper lifecycle logging for timestep and final-summary outputs.
Definition at line 766 of file test_logging.c.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Runs the unit-logging PETSc test binary.
Definition at line 825 of file test_logging.c.