Files
test/tests/python/geo_node_sim_test.py
Jacques Lucke 9535248911 Tests: support simulation nodes regression tests
Geometry nodes supports simulation nodes which allows later frames to depend
on previous frames. The existing geometry nodes regression tests only evaluated
the node tree at a single frame and therefore couldn't test the correct behavior of
simulations.

This adds a new kind of regression test that evaluates the scene at multiple
consecutive frames and then checks if the last frame matches.

Pull Request: https://projects.blender.org/blender/blender/pulls/109046
2023-06-16 10:00:55 +02:00

18 lines
520 B
Python

# SPDX-FileCopyrightText: 2009-2022 Blender Foundation
#
# SPDX-License-Identifier: GPL-2.0-or-later
import os
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from modules.mesh_test import GeoNodesSimulationTest
geo_node_test = GeoNodesSimulationTest("test_object", "expected_object", threshold=1e-4, frames_num=5)
result = geo_node_test.run_test()
# Telling `ctest` about the failed test by raising Exception.
if not result:
raise Exception("Failed {}".format(geo_node_test.test_name))