From 8dfb87d1af1193db64fa02b408c0a71d2bedbaaf Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 22 Feb 2024 14:17:52 +0100 Subject: [PATCH] Fix: Update tests data path to new directory --- build_files/cmake/testing.cmake | 4 ++-- source/blender/asset_system/tests/asset_catalog_test.cc | 4 ++-- source/blender/blenloader/tests/blendfile_load_test.cc | 2 +- .../blender/blenloader/tests/blendfile_loading_base_test.h | 4 ++-- tests/gtests/testing/testing.h | 2 +- tests/gtests/testing/testing_main.cc | 5 ++--- tests/python/bl_alembic_io_test.py | 2 +- tests/python/bl_animation_drivers.py | 2 +- tests/python/bl_animation_fcurves.py | 2 +- tests/python/bl_animation_keyframing.py | 2 +- tests/python/bl_blendfile_versioning.py | 2 +- tests/python/bl_constraints.py | 2 +- tests/python/bl_rigging_symmetrize.py | 2 +- tests/python/collada/animation/test_animation_simple.py | 2 +- tests/python/collada/mesh/test_mesh_simple.py | 2 +- tests/python/curve_to_mesh.py | 2 +- 16 files changed, 20 insertions(+), 21 deletions(-) diff --git a/build_files/cmake/testing.cmake b/build_files/cmake/testing.cmake index 7e888425b4a..73ae6d8396a 100644 --- a/build_files/cmake/testing.cmake +++ b/build_files/cmake/testing.cmake @@ -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} ) diff --git a/source/blender/asset_system/tests/asset_catalog_test.cc b/source/blender/asset_system/tests/asset_catalog_test.cc index ee5d37eab37..21b7aacaa77 100644 --- a/source/blender/asset_system/tests/asset_catalog_test.cc +++ b/source/blender/asset_system/tests/asset_catalog_test.cc @@ -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. */ diff --git a/source/blender/blenloader/tests/blendfile_load_test.cc b/source/blender/blenloader/tests/blendfile_load_test.cc index 0c7042afeb6..7a87ff387ed 100644 --- a/source/blender/blenloader/tests/blendfile_load_test.cc +++ b/source/blender/blenloader/tests/blendfile_load_test.cc @@ -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; } diff --git a/source/blender/blenloader/tests/blendfile_loading_base_test.h b/source/blender/blenloader/tests/blendfile_loading_base_test.h index fe50bbb584e..58116351446 100644 --- a/source/blender/blenloader/tests/blendfile_loading_base_test.h +++ b/source/blender/blenloader/tests/blendfile_loading_base_test.h @@ -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), diff --git a/tests/gtests/testing/testing.h b/tests/gtests/testing/testing.h index 5b0a73ff253..8142bebec03 100644 --- a/tests/gtests/testing/testing.h +++ b/tests/gtests/testing/testing.h @@ -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 diff --git a/tests/gtests/testing/testing_main.cc b/tests/gtests/testing/testing_main.cc index d8259262c11..29530b14c07 100644 --- a/tests/gtests/testing/testing_main.cc +++ b/tests/gtests/testing/testing_main.cc @@ -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; } diff --git a/tests/python/bl_alembic_io_test.py b/tests/python/bl_alembic_io_test.py index dc8e596fb84..07429f89837 100644 --- a/tests/python/bl_alembic_io_test.py +++ b/tests/python/bl_alembic_io_test.py @@ -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 diff --git a/tests/python/bl_animation_drivers.py b/tests/python/bl_animation_drivers.py index caca840f194..e7e95a401bd 100644 --- a/tests/python/bl_animation_drivers.py +++ b/tests/python/bl_animation_drivers.py @@ -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 """ diff --git a/tests/python/bl_animation_fcurves.py b/tests/python/bl_animation_fcurves.py index 0febdd48c06..bd9e243ff0d 100644 --- a/tests/python/bl_animation_fcurves.py +++ b/tests/python/bl_animation_fcurves.py @@ -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 diff --git a/tests/python/bl_animation_keyframing.py b/tests/python/bl_animation_keyframing.py index d696f6fa0e0..20b03919553 100644 --- a/tests/python/bl_animation_keyframing.py +++ b/tests/python/bl_animation_keyframing.py @@ -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 """ diff --git a/tests/python/bl_blendfile_versioning.py b/tests/python/bl_blendfile_versioning.py index d704f8c7cb8..7aa40494a1e 100644 --- a/tests/python/bl_blendfile_versioning.py +++ b/tests/python/bl_blendfile_versioning.py @@ -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", diff --git a/tests/python/bl_constraints.py b/tests/python/bl_constraints.py index 92f2548c4cb..2a54ba48398 100644 --- a/tests/python/bl_constraints.py +++ b/tests/python/bl_constraints.py @@ -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 diff --git a/tests/python/bl_rigging_symmetrize.py b/tests/python/bl_rigging_symmetrize.py index ea0202caa1b..47efb53b68d 100644 --- a/tests/python/bl_rigging_symmetrize.py +++ b/tests/python/bl_rigging_symmetrize.py @@ -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 diff --git a/tests/python/collada/animation/test_animation_simple.py b/tests/python/collada/animation/test_animation_simple.py index dd68c58057f..478d193ec12 100644 --- a/tests/python/collada/animation/test_animation_simple.py +++ b/tests/python/collada/animation/test_animation_simple.py @@ -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 diff --git a/tests/python/collada/mesh/test_mesh_simple.py b/tests/python/collada/mesh/test_mesh_simple.py index e147d43962e..96fa233f2ef 100644 --- a/tests/python/collada/mesh/test_mesh_simple.py +++ b/tests/python/collada/mesh/test_mesh_simple.py @@ -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 diff --git a/tests/python/curve_to_mesh.py b/tests/python/curve_to_mesh.py index fc41f16cd7d..fe0d299e371 100644 --- a/tests/python/curve_to_mesh.py +++ b/tests/python/curve_to_mesh.py @@ -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