Move tests/data and assets to the main repository
This change moves the tests data files and publish folder of assets repository to the main blender.git repository as LFS files. The goal of this change is to eliminate toil of modifying tests, cherry-picking changes to LFS branches, adding tests as part of a PR which brings new features or fixes. More detailed explanation and conversation can be found in the design task. Ref #137215 Pull Request: https://projects.blender.org/blender/blender/pulls/137219
This commit is contained in:
committed by
Sergey Sharybin
parent
1f51172692
commit
bbfc97ad6f
@@ -4,7 +4,7 @@
|
||||
|
||||
# Use '--write-blend=/tmp/test.blend' to view output
|
||||
|
||||
set(TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/tests/data)
|
||||
set(TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/tests/files)
|
||||
set(TEST_PYTHON_DIR ${CMAKE_SOURCE_DIR}/tests/python)
|
||||
set(TEST_OUT_DIR ${CMAKE_BINARY_DIR}/tests)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
"""
|
||||
./blender.bin --background --factory-startup --python tests/python/bl_alembic_io_test.py -- --testdir /path/to/tests/data/alembic
|
||||
./blender.bin --background --factory-startup --python tests/python/bl_alembic_io_test.py -- --testdir /path/to/tests/files/alembic
|
||||
"""
|
||||
|
||||
import math
|
||||
|
||||
@@ -9,7 +9,7 @@ import pathlib
|
||||
import bpy
|
||||
|
||||
"""
|
||||
blender -b --factory-startup --python tests/python/bl_animation_action.py -- --testdir tests/data/animation/
|
||||
blender -b --factory-startup --python tests/python/bl_animation_action.py -- --testdir tests/files/animation/
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
"""
|
||||
blender -b --factory-startup --python tests/python/bl_animation_drivers.py -- --testdir /path/to/tests/data/animation
|
||||
blender -b --factory-startup --python tests/python/bl_animation_drivers.py -- --testdir /path/to/tests/files/animation
|
||||
"""
|
||||
__all__ = (
|
||||
"main",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
"""
|
||||
blender -b --factory-startup --python tests/python/bl_animation_fcurves.py -- --testdir tests/data/animation
|
||||
blender -b --factory-startup --python tests/python/bl_animation_fcurves.py -- --testdir tests/files/animation
|
||||
"""
|
||||
|
||||
import pathlib
|
||||
|
||||
@@ -9,7 +9,7 @@ import sys
|
||||
from math import radians
|
||||
|
||||
"""
|
||||
blender -b --factory-startup --python tests/python/bl_animation_keyframing.py -- --testdir /path/to/tests/data/animation
|
||||
blender -b --factory-startup --python tests/python/bl_animation_keyframing.py -- --testdir /path/to/tests/files/animation
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class TestBlendFileOpenAllTestFiles(TestHelper):
|
||||
"ram_glsl.blend",
|
||||
}
|
||||
|
||||
# Directories to exclude relative to `./tests/data/`.
|
||||
# Directories to exclude relative to `./tests/files/`.
|
||||
self.excluded_dirs = ()
|
||||
|
||||
assert all(p.endswith("/") for p in self.excluded_dirs)
|
||||
@@ -144,7 +144,7 @@ def argparse_create():
|
||||
|
||||
# When --help or no args are given, print this help
|
||||
description = ("Test basic versioning code by opening all blend files "
|
||||
"in `tests/data` directory.")
|
||||
"in `tests/files` directory.")
|
||||
parser = argparse.ArgumentParser(description=description)
|
||||
parser.add_argument(
|
||||
"--src-test-dir",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
"""
|
||||
./blender.bin --background --factory-startup --python tests/python/bl_constraints.py -- --testdir /path/to/tests/data/constraints
|
||||
./blender.bin --background --factory-startup --python tests/python/bl_constraints.py -- --testdir /path/to/tests/files/constraints
|
||||
"""
|
||||
|
||||
import pathlib
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
"""
|
||||
blender -b --factory-startup --python tests/python/bl_pose_assets.py -- --testdir /path/to/tests/data/animation
|
||||
blender -b --factory-startup --python tests/python/bl_pose_assets.py -- --testdir /path/to/tests/files/animation
|
||||
"""
|
||||
|
||||
__all__ = (
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
"""
|
||||
blender -b --factory-startup --python tests/python/bl_rigging_symmetrize.py -- --testdir /path/to/tests/data/animation
|
||||
blender -b --factory-startup --python tests/python/bl_rigging_symmetrize.py -- --testdir /path/to/tests/files/animation
|
||||
"""
|
||||
|
||||
import pathlib
|
||||
|
||||
@@ -14,7 +14,7 @@ import numpy as np
|
||||
import bpy
|
||||
|
||||
"""
|
||||
blender -b --factory-startup --python tests/python/bl_sculpt.py -- --testdir tests/data/sculpting/
|
||||
blender -b --factory-startup --python tests/python/bl_sculpt.py -- --testdir tests/files/sculpting/
|
||||
"""
|
||||
|
||||
args = None
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
"""
|
||||
Call as follows:
|
||||
python collada_mesh_simple.py --blender PATH_TO_BLENDER_EXE --testdir tests/data/collada/mesh
|
||||
python collada_mesh_simple.py --blender PATH_TO_BLENDER_EXE --testdir tests/files/collada/mesh
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
"""
|
||||
Call as follows:
|
||||
python collada_mesh_simple.py --blender PATH_TO_BLENDER_EXE --testdir tests/data/collada/mesh
|
||||
python collada_mesh_simple.py --blender PATH_TO_BLENDER_EXE --testdir tests/files/collada/mesh
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# To run all tests, use
|
||||
# BLENDER_VERBOSE=1 ./bin/blender ../tests/data/modeling/curve_to_mesh.blend --python ../blender/tests/python/bl_curve_to_mesh.py -- --run-all-tests
|
||||
# BLENDER_VERBOSE=1 ./bin/blender ../tests/files/modeling/curve_to_mesh.blend --python ../blender/tests/python/bl_curve_to_mesh.py -- --run-all-tests
|
||||
# (that assumes the test is run from a build directory in the same directory as the source code)
|
||||
import bpy
|
||||
import os
|
||||
|
||||
@@ -131,7 +131,7 @@ class Report:
|
||||
message += """<p><tt>BLENDER_TEST_UPDATE=1 ctest -R %s</tt></p>""" % test_suite_name
|
||||
message += """<p>The reference output of new and failing tests will be updated. """ \
|
||||
"""Be sure to commit the new reference """ \
|
||||
"""files to the tests/data git submodule afterwards.</p>"""
|
||||
"""files to the tests/files git submodule afterwards.</p>"""
|
||||
message += """</div>"""
|
||||
message += f"Tested files: {self.tested_count}, <b>failed: {len(self.failed_list)}</b>"
|
||||
else:
|
||||
|
||||
@@ -343,7 +343,7 @@ class Report:
|
||||
message += """<p><tt>BLENDER_TEST_UPDATE=1 ctest -R %s</tt></p>""" % self.engine_name
|
||||
message += """<p>This then happens for new and failing tests; reference images of """ \
|
||||
"""passing test cases will not be updated. Be sure to commit the new reference """ \
|
||||
"""images to the tests/data git submodule afterwards.</p>"""
|
||||
"""images to the tests/files git submodule afterwards.</p>"""
|
||||
message += """</div>"""
|
||||
else:
|
||||
message = ""
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# To run all tests, use
|
||||
# BLENDER_VERBOSE=1 ./bin/blender ../blender/tests/data/modeling/object_conversion.blend --python ../blender/tests/python/object_conversion.py -- --run-all-tests
|
||||
# BLENDER_VERBOSE=1 ./bin/blender ../blender/tests/files/modeling/object_conversion.blend --python ../blender/tests/python/object_conversion.py -- --run-all-tests
|
||||
# (that assumes the test is run from a build directory in the same directory as the source code)
|
||||
import bpy
|
||||
import os
|
||||
|
||||
@@ -15,7 +15,7 @@ then passing it to the `run_test(permutations)` function.
|
||||
The `run_test` function also checks for a `--test` argument in `sys.argv`.
|
||||
When set, it will reproduce the state of a given test number.
|
||||
So:
|
||||
`blender "(...)/tests/data/overlay/<test>.blend" -P "(...)/tests/python/overlay/<test>.py" -- --test <test-number>`
|
||||
`blender "(...)/tests/files/overlay/<test>.blend" -P "(...)/tests/python/overlay/<test>.py" -- --test <test-number>`
|
||||
will open the blend file and set its state to the <test-number> permutation, instead of running the tests.
|
||||
|
||||
Common permutations can also be declared inside this file.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
# Use '--write-blend=/tmp/test.blend' to view output
|
||||
|
||||
set(TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/tests/data)
|
||||
set(TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/tests/files)
|
||||
set(TEST_OUT_DIR ${CMAKE_BINARY_DIR}/tests)
|
||||
|
||||
# ugh, any better way to do this on testing only?
|
||||
|
||||
Reference in New Issue
Block a user