diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/performance/api/device.py | 2 | ||||
-rw-r--r-- | tests/python/CMakeLists.txt | 20 | ||||
-rw-r--r-- | tests/python/bl_blendfile_liblink.py | 78 | ||||
-rwxr-xr-x | tests/python/modules/render_report.py | 6 |
4 files changed, 93 insertions, 13 deletions
diff --git a/tests/performance/api/device.py b/tests/performance/api/device.py index b61ae42be36..1e930a12352 100644 --- a/tests/performance/api/device.py +++ b/tests/performance/api/device.py @@ -11,7 +11,7 @@ def get_cpu_name() -> str: return platform.processor() elif platform.system() == "Darwin": cmd = ['/usr/sbin/sysctl', "-n", "machdep.cpu.brand_string"] - return subprocess.check_output(cmd).strip().decode('utf-8') + return subprocess.check_output(cmd).strip().decode('utf-8', 'ignore') else: with open('/proc/cpuinfo') as f: for line in f: diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 75f00c3c5cc..2b31b6362e9 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -749,10 +749,26 @@ set(geo_node_tests points utilities vector - volume - ) +if(WITH_GMP) + list(APPEND geo_node_tests mesh/boolean) +else() + MESSAGE(STATUS "Disabling mesh/boolean tests because WITH_GMP is off.") +endif() + +if(WITH_OPENVDB) + list(APPEND geo_node_tests volume) +else() + MESSAGE(STATUS "Disabling volume tests because WITH_OPENVDB is off.") +endif() + +if(WITH_OPENSUBDIV) + list(APPEND geo_node_tests mesh/subdivision_tests) +else() + MESSAGE(STATUS "Disabling mesh/subdivision_tests because WITH_OPENSUBDIV is off.") +endif() + foreach(geo_node_test ${geo_node_tests}) if(EXISTS "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/") file(GLOB files "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/*.blend") diff --git a/tests/python/bl_blendfile_liblink.py b/tests/python/bl_blendfile_liblink.py index 992bf6b89d9..4545e0b846a 100644 --- a/tests/python/bl_blendfile_liblink.py +++ b/tests/python/bl_blendfile_liblink.py @@ -10,7 +10,7 @@ from bl_blendfile_utils import TestHelper class TestBlendLibLinkHelper(TestHelper): - + def __init__(self, args): self.args = args @@ -165,7 +165,7 @@ class TestBlendLibAppendBasic(TestBlendLibLinkHelper): link_dir = os.path.join(output_lib_path, "Mesh") bpy.ops.wm.append(directory=link_dir, filename="LibMesh", - instance_object_data=False, set_fake=False, use_recursive=False) + instance_object_data=False, set_fake=False, use_recursive=False, do_reuse_local_id=False) assert(len(bpy.data.meshes) == 1) assert(bpy.data.meshes[0].library is None) @@ -179,7 +179,7 @@ class TestBlendLibAppendBasic(TestBlendLibLinkHelper): link_dir = os.path.join(output_lib_path, "Mesh") bpy.ops.wm.append(directory=link_dir, filename="LibMesh", - instance_object_data=True, set_fake=False, use_recursive=False) + instance_object_data=True, set_fake=False, use_recursive=False, do_reuse_local_id=False) assert(len(bpy.data.meshes) == 1) assert(bpy.data.meshes[0].library is None) @@ -194,7 +194,7 @@ class TestBlendLibAppendBasic(TestBlendLibLinkHelper): link_dir = os.path.join(output_lib_path, "Mesh") bpy.ops.wm.append(directory=link_dir, filename="LibMesh", - instance_object_data=False, set_fake=True, use_recursive=False) + instance_object_data=False, set_fake=True, use_recursive=False, do_reuse_local_id=False) assert(len(bpy.data.meshes) == 1) assert(bpy.data.meshes[0].library is None) @@ -208,7 +208,7 @@ class TestBlendLibAppendBasic(TestBlendLibLinkHelper): link_dir = os.path.join(output_lib_path, "Object") bpy.ops.wm.append(directory=link_dir, filename="LibMesh", - instance_object_data=False, set_fake=False, use_recursive=False) + instance_object_data=False, set_fake=False, use_recursive=False, do_reuse_local_id=False) assert(len(bpy.data.meshes) == 1) # This one fails currently, for unclear reasons. @@ -224,7 +224,7 @@ class TestBlendLibAppendBasic(TestBlendLibLinkHelper): link_dir = os.path.join(output_lib_path, "Object") bpy.ops.wm.append(directory=link_dir, filename="LibMesh", - instance_object_data=False, set_fake=False, use_recursive=True) + instance_object_data=False, set_fake=False, use_recursive=True, do_reuse_local_id=False) assert(len(bpy.data.meshes) == 1) assert(bpy.data.meshes[0].library is None) @@ -239,7 +239,7 @@ class TestBlendLibAppendBasic(TestBlendLibLinkHelper): link_dir = os.path.join(output_lib_path, "Collection") bpy.ops.wm.append(directory=link_dir, filename="LibMesh", - instance_object_data=False, set_fake=False, use_recursive=True) + instance_object_data=False, set_fake=False, use_recursive=True, do_reuse_local_id=False) assert(bpy.data.meshes[0].library is None) assert(bpy.data.meshes[0].users == 1) @@ -251,9 +251,73 @@ class TestBlendLibAppendBasic(TestBlendLibLinkHelper): assert(bpy.data.collections[0].users == 1) +class TestBlendLibAppendReuseID(TestBlendLibLinkHelper): + + def __init__(self, args): + self.args = args + + def test_append(self): + output_dir = self.args.output_dir + output_lib_path = self.init_lib_data_basic() + + # Append of a single Object, and then append it again. + self.reset_blender() + + link_dir = os.path.join(output_lib_path, "Object") + bpy.ops.wm.append(directory=link_dir, filename="LibMesh", + instance_object_data=False, set_fake=False, use_recursive=True, do_reuse_local_id=False) + + assert(len(bpy.data.meshes) == 1) + assert(bpy.data.meshes[0].library is None) + assert(bpy.data.meshes[0].use_fake_user is False) + assert(bpy.data.meshes[0].users == 1) + assert(bpy.data.meshes[0].library_weak_reference is not None) + assert(bpy.data.meshes[0].library_weak_reference.filepath == output_lib_path) + assert(bpy.data.meshes[0].library_weak_reference.id_name == "MELibMesh") + assert(len(bpy.data.objects) == 1) + for ob in bpy.data.objects: + assert(ob.library is None) + assert(ob.library_weak_reference is None) + assert(len(bpy.data.collections) == 0) # Scene's master collection is not listed here + + bpy.ops.wm.append(directory=link_dir, filename="LibMesh", + instance_object_data=False, set_fake=False, use_recursive=True, do_reuse_local_id=True) + + assert(len(bpy.data.meshes) == 1) + assert(bpy.data.meshes[0].library is None) + assert(bpy.data.meshes[0].use_fake_user is False) + assert(bpy.data.meshes[0].users == 2) + assert(bpy.data.meshes[0].library_weak_reference is not None) + assert(bpy.data.meshes[0].library_weak_reference.filepath == output_lib_path) + assert(bpy.data.meshes[0].library_weak_reference.id_name == "MELibMesh") + assert(len(bpy.data.objects) == 2) + for ob in bpy.data.objects: + assert(ob.library is None) + assert(ob.library_weak_reference is None) + assert(len(bpy.data.collections) == 0) # Scene's master collection is not listed here + + bpy.ops.wm.append(directory=link_dir, filename="LibMesh", + instance_object_data=False, set_fake=False, use_recursive=True, do_reuse_local_id=False) + + assert(len(bpy.data.meshes) == 2) + assert(bpy.data.meshes[0].library_weak_reference is None) + assert(bpy.data.meshes[1].library is None) + assert(bpy.data.meshes[1].use_fake_user is False) + assert(bpy.data.meshes[1].users == 1) + assert(bpy.data.meshes[1].library_weak_reference is not None) + assert(bpy.data.meshes[1].library_weak_reference.filepath == output_lib_path) + assert(bpy.data.meshes[1].library_weak_reference.id_name == "MELibMesh") + assert(len(bpy.data.objects) == 3) + for ob in bpy.data.objects: + assert(ob.library is None) + assert(ob.library_weak_reference is None) + assert(len(bpy.data.collections) == 0) # Scene's master collection is not listed here + + TESTS = ( TestBlendLibLinkSaveLoadBasic, TestBlendLibAppendBasic, + TestBlendLibAppendReuseID, ) diff --git a/tests/python/modules/render_report.py b/tests/python/modules/render_report.py index 560f8e33585..90f16dc80fb 100755 --- a/tests/python/modules/render_report.py +++ b/tests/python/modules/render_report.py @@ -410,7 +410,7 @@ class Report: failed = False except subprocess.CalledProcessError as e: if self.verbose: - print_message(e.output.decode("utf-8")) + print_message(e.output.decode("utf-8", 'ignore')) failed = e.returncode != 1 else: if not self.update: @@ -437,7 +437,7 @@ class Report: subprocess.check_output(command) except subprocess.CalledProcessError as e: if self.verbose: - print_message(e.output.decode("utf-8")) + print_message(e.output.decode("utf-8", 'ignore')) return not failed @@ -488,7 +488,7 @@ class Report: if verbose: print(" ".join(command)) if (verbose or crash) and output: - print(output.decode("utf-8")) + print(output.decode("utf-8", 'ignore')) # Detect missing filepaths and consider those errors for filepath, output_filepath in zip(remaining_filepaths[:], output_filepaths): |