Fix: Update tests data path to new directory

This commit is contained in:
Brecht Van Lommel 2024-02-22 14:17:52 +01:00
parent b5c8505f5a
commit 8dfb87d1af
16 changed files with 20 additions and 21 deletions

@ -163,14 +163,14 @@ function(blender_add_ctests)
TEST_PREFIX ${ARGS_SUITE_NAME}
WORKING_DIRECTORY "${TEST_INSTALL_DIR}"
EXTRA_ARGS
--test-assets-dir "${CMAKE_SOURCE_DIR}/../lib/tests"
--test-assets-dir "${CMAKE_SOURCE_DIR}/tests/data"
--test-release-dir "${_test_release_dir}"
)
else()
add_test(
NAME ${ARGS_SUITE_NAME}
COMMAND ${ARGS_TARGET}
--test-assets-dir "${CMAKE_SOURCE_DIR}/../lib/tests"
--test-assets-dir "${CMAKE_SOURCE_DIR}/tests/data"
--test-release-dir "${_test_release_dir}"
WORKING_DIRECTORY ${TEST_INSTALL_DIR}
)

@ -19,7 +19,7 @@
namespace blender::asset_system::tests {
/* UUIDs from lib/tests/asset_library/blender_assets.cats.txt */
/* UUIDs from tests/data/asset_library/blender_assets.cats.txt */
const bUUID UUID_ID_WITHOUT_PATH("e34dd2c5-5d2e-4668-9794-1db5de2a4f71");
const bUUID UUID_POSES_ELLIE("df60e1f6-2259-475b-93d9-69a1b4a8db78");
const bUUID UUID_POSES_ELLIE_WHITESPACE("b06132f6-5687-4751-a6dd-392740eb3c46");
@ -31,7 +31,7 @@ const bUUID UUID_POSES_RUZENA_FACE("82162c1f-06cc-4d91-a9bf-4f72c104e348");
const bUUID UUID_WITHOUT_SIMPLENAME("d7916a31-6ca9-4909-955f-182ca2b81fa3");
const bUUID UUID_ANOTHER_RUZENA("00000000-d9fa-4b91-b704-e6af1f1339ef");
/* UUIDs from lib/tests/asset_library/modified_assets.cats.txt */
/* UUIDs from tests/data/asset_library/modified_assets.cats.txt */
const bUUID UUID_AGENT_47("c5744ba5-43f5-4f73-8e52-010ad4a61b34");
/* Subclass that adds accessors such that protected fields can be used in tests. */

@ -9,7 +9,7 @@ class BlendfileLoadingTest : public BlendfileLoadingBaseTest {};
TEST_F(BlendfileLoadingTest, CanaryTest)
{
/* Load the smallest blend file we have in the SVN lib/tests directory. */
/* Load the smallest blend file we have in the tests/data directory. */
if (!blendfile_load("modifier_stack" SEP_STR "array_test.blend")) {
return;
}

@ -25,10 +25,10 @@ class BlendfileLoadingBaseTest : public testing::Test {
/* Frees the depsgraph & blendfile. */
virtual void TearDown();
/* Loads a blend file from the lib/tests directory from SVN.
/* Loads a blend file from the tests/data directory from SVN.
* Returns 'ok' flag (true=good, false=bad) and sets this->bfile.
* Fails the test if the file cannot be loaded (still returns though).
* Requires the CLI argument --test-asset-dir to point to ../../lib/tests.
* Requires the CLI argument --test-asset-dir to point to ../tests/data.
*
* WARNING: only files saved with Blender 2.80+ can be loaded. Since Blender
* is only partially initialized (most importantly, without window manager),

@ -14,7 +14,7 @@ namespace blender::tests {
/* These strings are passed on the CLI with the --test-asset-dir and --test-release-dir arguments.
* The arguments are added automatically when invoking tests via `ctest`. */
const std::string &flags_test_asset_dir(); /* ../lib/tests in the SVN directory. */
const std::string &flags_test_asset_dir(); /* tests/data in the Blender repository. */
const std::string &flags_test_release_dir(); /* bin/{blender version} in the build directory. */
} // namespace blender::tests

@ -6,7 +6,7 @@
#include "MEM_guardedalloc.h"
DEFINE_string(test_assets_dir, "", "lib/tests directory from SVN containing the test assets.");
DEFINE_string(test_assets_dir, "", "tests/data directory containing the test assets.");
DEFINE_string(test_release_dir, "", "bin/{blender version} directory of the current build.");
namespace blender::tests {
@ -14,8 +14,7 @@ namespace blender::tests {
const std::string &flags_test_asset_dir()
{
if (FLAGS_test_assets_dir.empty()) {
ADD_FAILURE()
<< "Pass the flag --test-assets-dir and point to the lib/tests directory from SVN.";
ADD_FAILURE() << "Pass the flag --test-assets-dir and point to the tests/data directory.";
}
return FLAGS_test_assets_dir;
}

@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
"""
./blender.bin --background -noaudio --factory-startup --python tests/python/bl_alembic_io_test.py -- --testdir /path/to/lib/tests/alembic
./blender.bin --background -noaudio --factory-startup --python tests/python/bl_alembic_io_test.py -- --testdir /path/to/tests/data/alembic
"""
import math

@ -9,7 +9,7 @@ import sys
from rna_prop_ui import rna_idprop_quote_path
"""
blender -b -noaudio --factory-startup --python tests/python/bl_animation_drivers.py -- --testdir /path/to/lib/tests/animation
blender -b -noaudio --factory-startup --python tests/python/bl_animation_drivers.py -- --testdir /path/to/tests/data/animation
"""

@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
"""
blender -b -noaudio --factory-startup --python tests/python/bl_animation_fcurves.py -- --testdir /path/to/lib/tests/animation
blender -b -noaudio --factory-startup --python tests/python/bl_animation_fcurves.py -- --testdir /path/to/tests/data/animation
"""
import pathlib

@ -9,7 +9,7 @@ import sys
from math import radians
"""
blender -b -noaudio --factory-startup --python tests/python/bl_animation_keyframing.py -- --testdir /path/to/lib/tests/animation
blender -b -noaudio --factory-startup --python tests/python/bl_animation_keyframing.py -- --testdir /path/to/tests/data/animation
"""

@ -75,7 +75,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 `lib/tests` directory.")
"in `tests/data` 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 -noaudio --factory-startup --python tests/python/bl_constraints.py -- --testdir /path/to/lib/tests/constraints
./blender.bin --background -noaudio --factory-startup --python tests/python/bl_constraints.py -- --testdir /path/to/tests/data/constraints
"""
import pathlib

@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
"""
blender -b -noaudio --factory-startup --python tests/python/bl_rigging_symmetrize.py -- --testdir /path/to/lib/tests/animation
blender -b -noaudio --factory-startup --python tests/python/bl_rigging_symmetrize.py -- --testdir /path/to/tests/data/animation
"""
import pathlib

@ -5,7 +5,7 @@
"""
Call as follows:
python collada_mesh_simple.py --blender PATH_TO_BLENDER_EXE --testdir PATH_TO_SVN/lib/tests/collada/mesh
python collada_mesh_simple.py --blender PATH_TO_BLENDER_EXE --testdir tests/data/collada/mesh
"""
import sys

@ -5,7 +5,7 @@
"""
Call as follows:
python collada_mesh_simple.py --blender PATH_TO_BLENDER_EXE --testdir PATH_TO_SVN/lib/tests/collada/mesh
python collada_mesh_simple.py --blender PATH_TO_BLENDER_EXE --testdir tests/data/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 ../lib/tests/modeling/curve_to_mesh.blend --python ../blender/tests/python/bl_curve_to_mesh.py -- --run-all-tests
# BLENDER_VERBOSE=1 ./bin/blender ../tests/data/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