2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2009-2022 Blender Authors
|
2023-06-15 13:09:04 +10:00
|
|
|
#
|
2022-02-11 09:07:11 +11:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2021-07-27 21:00:28 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
import sys
|
2025-04-13 13:55:23 +02:00
|
|
|
import bpy
|
2021-07-27 21:00:28 +05:30
|
|
|
|
|
|
|
|
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
|
|
|
|
from modules.mesh_test import BlendFileTest
|
|
|
|
|
|
2025-04-13 13:55:23 +02:00
|
|
|
if "closure" in bpy.data.filepath:
|
|
|
|
|
if bpy.app.version_cycle == "alpha":
|
|
|
|
|
bpy.context.preferences.experimental.use_bundle_and_closure_nodes = True
|
|
|
|
|
else:
|
|
|
|
|
print("Skipped because bundles and closures are still experimental.")
|
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
2021-08-02 10:38:11 +02:00
|
|
|
geo_node_test = BlendFileTest("test_object", "expected_object", threshold=1e-4)
|
2021-07-27 21:00:28 +05:30
|
|
|
result = geo_node_test.run_test()
|
|
|
|
|
|
|
|
|
|
# Telling `ctest` about the failed test by raising Exception.
|
2022-04-26 15:03:04 +10:00
|
|
|
if not result:
|
2021-07-27 21:00:28 +05:30
|
|
|
raise Exception("Failed {}".format(geo_node_test.test_name))
|