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:
Diffstat (limited to 'tests/python')
-rw-r--r--tests/python/CMakeLists.txt33
-rwxr-xr-xtests/python/alembic_tests.py2
-rw-r--r--tests/python/bl_alembic_import_test.py7
-rw-r--r--tests/python/bl_keymap_completeness.py1
-rw-r--r--tests/python/bl_load_py_modules.py8
-rw-r--r--tests/python/pep8.py1
-rw-r--r--tests/python/rna_info_dump.py1
7 files changed, 38 insertions, 15 deletions
diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index ac480f4d58c..9e1ebcbe669 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -49,7 +49,8 @@ endif()
# for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no
set(TEST_BLENDER_EXE_BARE ${TEST_BLENDER_EXE})
-set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)
+set(TEST_BLENDER_EXE_PARAMS --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)
+set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} ${TEST_BLENDER_EXE_PARAMS} )
# ------------------------------------------------------------------------------
@@ -103,15 +104,15 @@ add_test(bevel ${TEST_BLENDER_EXE}
)
add_test(split_faces ${TEST_BLENDER_EXE}
- ${TEST_SRC_DIR}/modeling/split_faces_test.blend
- --python-text run_tests
+ ${TEST_SRC_DIR}/modeling/split_faces_test.blend
+ --python-text run_tests
)
# ------------------------------------------------------------------------------
# MODIFIERS TESTS
add_test(modifier_array ${TEST_BLENDER_EXE}
- ${TEST_SRC_DIR}/modifier_stack/array_test.blend
- --python-text run_tests
+ ${TEST_SRC_DIR}/modifier_stack/array_test.blend
+ --python-text run_tests
)
# ------------------------------------------------------------------------------
@@ -458,12 +459,6 @@ if(WITH_ALEMBIC)
get_filename_component(real_include_dir ${ALEMBIC_INCLUDE_DIR} REALPATH)
get_filename_component(ALEMBIC_ROOT_DIR ${real_include_dir} DIRECTORY)
- add_test(script_alembic_import ${TEST_BLENDER_EXE}
- --python ${CMAKE_CURRENT_LIST_DIR}/bl_alembic_import_test.py
- --
- --testdir "${TEST_SRC_DIR}/alembic"
- )
-
if(MSVC)
add_test(NAME alembic_tests
COMMAND
@@ -473,6 +468,15 @@ if(WITH_ALEMBIC)
--testdir "${TEST_SRC_DIR}/alembic"
--alembic-root "${ALEMBIC_ROOT_DIR}"
)
+ add_test(NAME script_alembic_import
+ COMMAND
+ "$<TARGET_FILE:blender>" ${TEST_BLENDER_EXE_PARAMS}
+ --python ${CMAKE_CURRENT_LIST_DIR}/bl_alembic_import_test.py
+ --
+ --testdir "${TEST_SRC_DIR}/alembic"
+ --with-legacy-depsgraph=${WITH_LEGACY_DEPSGRAPH}
+ )
+
else()
add_test(alembic_tests
${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py
@@ -480,5 +484,12 @@ if(WITH_ALEMBIC)
--testdir "${TEST_SRC_DIR}/alembic"
--alembic-root "${ALEMBIC_ROOT_DIR}"
)
+ add_test(script_alembic_import ${TEST_BLENDER_EXE}
+ --python ${CMAKE_CURRENT_LIST_DIR}/bl_alembic_import_test.py
+ --
+ --testdir "${TEST_SRC_DIR}/alembic"
+ --with-legacy-depsgraph=${WITH_LEGACY_DEPSGRAPH}
+ )
+
endif()
endif()
diff --git a/tests/python/alembic_tests.py b/tests/python/alembic_tests.py
index e36a6391298..96a68de9801 100755
--- a/tests/python/alembic_tests.py
+++ b/tests/python/alembic_tests.py
@@ -157,6 +157,8 @@ class AbstractAlembicTest(unittest.TestCase):
if proptype == 'CompoundProperty':
# To read those, call self.abcprop() on it.
continue
+ if len(parts) < 2:
+ raise ValueError('Error parsing result from abcprop: %s', info.strip())
valtype_and_arrsize, name_and_extent = parts[1:]
# Parse name and extent
diff --git a/tests/python/bl_alembic_import_test.py b/tests/python/bl_alembic_import_test.py
index 358b8a3c758..d8cd64a1d56 100644
--- a/tests/python/bl_alembic_import_test.py
+++ b/tests/python/bl_alembic_import_test.py
@@ -129,6 +129,9 @@ class SimpleImportTest(AbstractAlembicTest):
bpy.data.cache_files[fname].filepath = relpath.replace('1.abc', '2.abc')
bpy.context.scene.update()
+ if args.with_legacy_depsgraph:
+ bpy.context.scene.frame_set(10)
+
x, y, z = cube.matrix_world.to_euler('XYZ')
self.assertAlmostEqual(x, math.pi / 2, places=5)
self.assertAlmostEqual(y, 0)
@@ -207,12 +210,14 @@ def main():
import argparse
if '--' in sys.argv:
- argv = [sys.argv[0]] + sys.argv[sys.argv.index('--')+1:]
+ argv = [sys.argv[0]] + sys.argv[sys.argv.index('--') + 1:]
else:
argv = sys.argv
parser = argparse.ArgumentParser()
parser.add_argument('--testdir', required=True, type=pathlib.Path)
+ parser.add_argument('--with-legacy-depsgraph', default=False,
+ type=lambda v: v in {'ON', 'YES', 'TRUE'})
args, remaining = parser.parse_known_args(argv)
unittest.main(argv=remaining)
diff --git a/tests/python/bl_keymap_completeness.py b/tests/python/bl_keymap_completeness.py
index 00322907f69..652ed449a3c 100644
--- a/tests/python/bl_keymap_completeness.py
+++ b/tests/python/bl_keymap_completeness.py
@@ -80,5 +80,6 @@ def main():
import sys
sys.exit(1)
+
if __name__ == "__main__":
main()
diff --git a/tests/python/bl_load_py_modules.py b/tests/python/bl_load_py_modules.py
index c13679d16f0..4935491a6be 100644
--- a/tests/python/bl_load_py_modules.py
+++ b/tests/python/bl_load_py_modules.py
@@ -36,6 +36,9 @@ BLACKLIST = {
"cycles",
"io_export_dxf", # TODO, check on why this fails
'io_import_dxf', # Because of cydxfentity.so dependency
+
+ # The unpacked wheel is only loaded when actually used, not directly on import:
+ "io_blend_utils/blender_bam-unpacked.whl",
}
# Some modules need to add to the `sys.path`.
@@ -211,11 +214,10 @@ def load_modules():
[(os.sep + f + ".py") for f in BLACKLIST])
for f in source_files:
- ok = False
for ignore in ignore_paths:
if ignore in f:
- ok = True
- if not ok:
+ break
+ else:
raise Exception("Source file %r not loaded in test" % f)
print("loaded %d modules" % len(loaded_files))
diff --git a/tests/python/pep8.py b/tests/python/pep8.py
index 0e6250f534b..dde4250f6aa 100644
--- a/tests/python/pep8.py
+++ b/tests/python/pep8.py
@@ -178,5 +178,6 @@ def main():
"--max-line-length=1000"
" '%s'" % f)
+
if __name__ == "__main__":
main()
diff --git a/tests/python/rna_info_dump.py b/tests/python/rna_info_dump.py
index c26d94a1246..da228e52652 100644
--- a/tests/python/rna_info_dump.py
+++ b/tests/python/rna_info_dump.py
@@ -127,5 +127,6 @@ def api_dump(use_properties=True, use_functions=True):
print("END")
+
if __name__ == "__main__":
api_dump()