你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00

- 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).
57 行
1.6 KiB
Python
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)
|