diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-04-28 16:52:07 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-04-28 16:52:07 +0300 |
commit | 074c5f0d26b20fbb69e558af3e9a6f4183a2ad29 (patch) | |
tree | c724af247c52754db1c8426c2ded278859a8b35c /tests | |
parent | 08142dde2c87b14da505c126350bb49054cf054f (diff) | |
parent | aa88796a6cb6cb65b87508d87c51f1d58234f2ee (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'tests')
-rw-r--r-- | tests/python/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | tests/python/alembic_tests.py | 19 |
2 files changed, 13 insertions, 8 deletions
diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 9042b804be9..5240a4144c9 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -462,7 +462,7 @@ if(WITH_ALEMBIC) COMMAND "$<TARGET_FILE_DIR:blender>/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>" ${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py - --blender "${TEST_BLENDER_EXE_BARE}" + --blender "$<TARGET_FILE:blender>" --testdir "${TEST_SRC_DIR}/alembic" --alembic-root "${ALEMBIC_ROOT_DIR}" ) diff --git a/tests/python/alembic_tests.py b/tests/python/alembic_tests.py index 2a2dd0230cf..e36a6391298 100755 --- a/tests/python/alembic_tests.py +++ b/tests/python/alembic_tests.py @@ -124,6 +124,11 @@ class AbstractAlembicTest(unittest.TestCase): coloured_output = proc.stdout output = self.ansi_remove_re.sub(b'', coloured_output).decode('utf8') + # Because of the ANSI colour codes, we need to remove those first before + # decoding to text. This means that we cannot use the universal_newlines + # parameter to subprocess.run(), and have to do the conversion ourselves + output = output.replace('\r\n', '\n').replace('\r', '\n') + if proc.returncode: raise AbcPropError('Error %d running abcls:\n%s' % (proc.returncode, output)) @@ -217,7 +222,7 @@ class HierarchicalAndFlatExportTest(AbstractAlembicTest): def test_hierarchical_export(self, tempdir: pathlib.Path): abc = tempdir / 'cubes_hierarchical.abc' script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \ - "renderable_only=True, visible_layers_only=True, flatten=False)" % abc + "renderable_only=True, visible_layers_only=True, flatten=False)" % abc.as_posix() self.run_blender('cubes-hierarchy.blend', script) # Now check the resulting Alembic file. @@ -235,7 +240,7 @@ class HierarchicalAndFlatExportTest(AbstractAlembicTest): def test_flat_export(self, tempdir: pathlib.Path): abc = tempdir / 'cubes_flat.abc' script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \ - "renderable_only=True, visible_layers_only=True, flatten=True)" % abc + "renderable_only=True, visible_layers_only=True, flatten=True)" % abc.as_posix() self.run_blender('cubes-hierarchy.blend', script) # Now check the resulting Alembic file. @@ -256,7 +261,7 @@ class DupliGroupExportTest(AbstractAlembicTest): def test_hierarchical_export(self, tempdir: pathlib.Path): abc = tempdir / 'dupligroup_hierarchical.abc' script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \ - "renderable_only=True, visible_layers_only=True, flatten=False)" % abc + "renderable_only=True, visible_layers_only=True, flatten=False)" % abc.as_posix() self.run_blender('dupligroup-scene.blend', script) # Now check the resulting Alembic file. @@ -274,7 +279,7 @@ class DupliGroupExportTest(AbstractAlembicTest): def test_flat_export(self, tempdir: pathlib.Path): abc = tempdir / 'dupligroup_hierarchical.abc' script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \ - "renderable_only=True, visible_layers_only=True, flatten=True)" % abc + "renderable_only=True, visible_layers_only=True, flatten=True)" % abc.as_posix() self.run_blender('dupligroup-scene.blend', script) # Now check the resulting Alembic file. @@ -295,7 +300,7 @@ class CurveExportTest(AbstractAlembicTest): def test_export_single_curve(self, tempdir: pathlib.Path): abc = tempdir / 'single-curve.abc' script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \ - "renderable_only=True, visible_layers_only=True, flatten=False)" % abc + "renderable_only=True, visible_layers_only=True, flatten=False)" % abc.as_posix() self.run_blender('single-curve.blend', script) # Now check the resulting Alembic file. @@ -318,7 +323,7 @@ class HairParticlesExportTest(AbstractAlembicTest): script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \ "renderable_only=True, visible_layers_only=True, flatten=False, " \ "export_hair=%r, export_particles=%r, as_background_job=False)" \ - % (abc, export_hair, export_particles) + % (abc.as_posix(), export_hair, export_particles) self.run_blender('hair-particles.blend', script) return abc @@ -377,7 +382,7 @@ class LongNamesExportTest(AbstractAlembicTest): def test_export_long_names(self, tempdir: pathlib.Path): abc = tempdir / 'long-names.abc' script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \ - "renderable_only=False, visible_layers_only=False, flatten=False)" % abc + "renderable_only=False, visible_layers_only=False, flatten=False)" % abc.as_posix() self.run_blender('long-names.blend', script) name_parts = [ |