|
Gromacs
2027.0-dev-20261112-5a4f586
|
#include <testutils/include/testutils/hardware_test_fixture.h>
Inherits TestWithParam< TestHelper::DynamicParameters >.
Base class for hardware-parameterized tests.
Provides infrastructure for tests using HardwareAndExecutionTestHelper:
See file-level documentation for complete usage examples.
| TestHelper | A HardwareAndExecutionTestHelper instantiation that provides the parameterization over input configs and execution modes. |
Public Types | |
| using | ParametersTuple = typename TestHelper::DynamicParameters |
| Parameter tuple type, including input config, execution mode, and hardware contexts. | |
Protected Member Functions | |
| HardwareTestFixture (typename TestHelper::InputConfigFormatters inputFormatters) | |
| Constructor. More... | |
| void | SetUp () override |
| SetUp override - performs custom skip checks and creates checker. More... | |
| virtual void | addCustomSkipReasons (MessageStringCollector &skipReasons) |
| Virtual hook for derived classes to add custom skip conditions. More... | |
| const TestHardwareContext * | hardwareContext () const |
| Get hardware context (extracted from parameter tuple) | |
| TestReferenceChecker & | checker () |
| Get reference checker. More... | |
| void | activateHardware () const |
| Activate hardware (sets device for GPU, no-op for CPU) | |
| bool | isGpuTest () const |
| Check if this is a GPU test. | |
| std::optional< int > | gpuId () const |
| Get GPU ID if GPU test, std::nullopt otherwise. | |
| const DeviceContext * | deviceContext () const |
| Get device context (nullptr for CPU, convenience wrapper for hardwareContext()->deviceContext()) | |
| const DeviceStream * | deviceStream () const |
| Get device stream (nullptr for CPU, convenience wrapper for hardwareContext()->deviceStream()) | |
|
inlineexplicitprotected |
Constructor.
Takes input config formatters and automatically creates the RefDataFilenameMaker internally. See file-level documentation for complete usage examples.
| [in] | inputFormatters | Tuple of formatter functions for input config parameters |
|
inlineprotectedvirtual |
Virtual hook for derived classes to add custom skip conditions.
Called from SetUp() (NOT constructor) to add test-specific skip logic. Derived classes can override this to add parameter-dependent skip conditions.
| [in,out] | skipReasons | Collector to append skip reasons to |
Default implementation does nothing (no custom skip logic).
Reimplemented in gmx::test::anonymous_namespace{bonded.cpp}::ListedForcesTest.
|
inlineprotected |
Get reference checker.
Safe to call after SetUp() completes. Asserts if called before checker is initialized (which should be impossible if used correctly).
|
inlineoverrideprotected |
SetUp override - performs custom skip checks and creates checker.
Called by GoogleTest after construction is complete. This is where custom skip logic runs via the virtual addCustomSkipReasons() hook.
If derived classes override SetUp(), they MUST call base SetUp() first:
1.8.5