Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2017-04-28 16:28:41 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2017-04-28 16:28:41 +0300
commit1e8d7f3b25a3dd6d118123c889374f32c0f8af51 (patch)
tree1184a4f67a7c0e8a54810e29291bc3228941378e /tests/python
parentf383c926b43e832d1c4e2bf5cd00812a88f0c059 (diff)
Fix T51331: fixes for Alembic unit tests on Windows
Diffstat (limited to 'tests/python')
-rw-r--r--tests/python/CMakeLists.txt2
-rwxr-xr-xtests/python/alembic_tests.py19
2 files changed, 13 insertions, 8 deletions
diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index 1dddacc191b..1ee5ce8b88a 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 = [