文件
gprMax/reframe_tests/tests/standard_tests.py
Nathan Mannall 2295b71e78 Remove need for git lfs to store large files
- Reduce the size of the regression files for testing geometry objects
- Don't save geometry objects when testing geometry commands. This means
  the regression check is done using the receiver output rather than
  reading the geometry directly. Some tests still output the geometry
  for reference (useful if tests fail to check the geometry that was
  built).
2025-06-19 15:18:31 +01:00

57 行
1.6 KiB
Python

from pathlib import Path
from reframe.core.builtins import run_before
from reframe_tests.tests.base_tests import GprMaxBaseTest
from reframe_tests.tests.mixins import (
GeometryObjectsReadMixin,
GeometryObjectsWriteMixin,
GeometryOnlyMixin,
GeometryViewMixin,
ReceiverMixin,
SnapshotMixin,
)
from reframe_tests.tests.regression_checks import GeometryObjectMaterialsRegressionCheck
class GprMaxRegressionTest(ReceiverMixin, GprMaxBaseTest):
pass
class GprMaxSnapshotTest(SnapshotMixin, GprMaxBaseTest):
pass
class GprMaxGeometryViewTest(GeometryViewMixin, GeometryOnlyMixin, GprMaxBaseTest):
pass
class GprMaxGeometryObjectsWriteTest(GeometryObjectsWriteMixin, GprMaxBaseTest):
pass
class GprMaxGeometryObjectsReadTest(GeometryObjectsReadMixin, GprMaxBaseTest):
pass
class GprMaxGeometryObjectsReadWriteTest(
GeometryObjectsReadMixin, GeometryObjectsWriteMixin, GprMaxBaseTest
):
@run_before("sanity")
def update_material_files(self):
checks = [
check
for check in self.regression_checks
if isinstance(check, GeometryObjectMaterialsRegressionCheck)
]
for check in checks:
for geometry_object in self.geometry_objects_read.values():
material_file = Path(self.stagedir, check.output_file)
with open(material_file, "r") as f:
lines = f.readlines()
with open(material_file, "w") as f:
for line in lines:
new_line = line.replace(f"{{{geometry_object}_materials}}", "")
f.write(new_line)