diff --git a/CMakeLists.txt b/CMakeLists.txt index a46c0a1cc2f..559382080f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2354,6 +2354,12 @@ if(WITH_PLAYER) add_subdirectory(source/blenderplayer) endif() + +#----------------------------------------------------------------------------- +# Testing +add_subdirectory(tests) + + #----------------------------------------------------------------------------- # CPack for generating packages include(build_files/cmake/packaging.cmake) diff --git a/GNUmakefile b/GNUmakefile index 4f76cb3565d..c7807720cb9 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -223,7 +223,7 @@ test: # run pep8 check check on scripts we distribute. test_pep8: - python3 source/tests/pep8.py > test_pep8.log 2>&1 + python3 tests/python/pep8.py > test_pep8.log 2>&1 @echo "written: test_pep8.log" # run some checks on our cmakefiles. @@ -233,7 +233,7 @@ test_cmake: # run deprecation tests, see if we have anything to remove. test_deprecated: - python3 source/tests/check_deprecated.py + python3 tests/check_deprecated.py test_style_c: # run our own checks on C/C++ style diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 391fdf42d28..c696719e650 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -29,4 +29,3 @@ if(WITH_GAMEENGINE) add_subdirectory(gameengine) endif() -add_subdirectory(tests) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000000..78262f54782 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,4 @@ + +# Python CTests +add_subdirectory(python) + diff --git a/source/tests/check_deprecated.py b/tests/check_deprecated.py similarity index 97% rename from source/tests/check_deprecated.py rename to tests/check_deprecated.py index bb9fcd818d2..d7193155b1c 100644 --- a/source/tests/check_deprecated.py +++ b/tests/check_deprecated.py @@ -25,7 +25,7 @@ DEPRECATE_DAYS = 120 SKIP_DIRS = ("extern", "scons", - os.path.join("source", "tests"), # not this dir + "tests", # not this dir ) @@ -76,7 +76,7 @@ def deprecations(): """ import datetime - SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..")))) + SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..")))) SKIP_DIRS_ABS = [os.path.join(SOURCE_DIR, p) for p in SKIP_DIRS] diff --git a/source/tests/CMakeLists.txt b/tests/python/CMakeLists.txt similarity index 100% rename from source/tests/CMakeLists.txt rename to tests/python/CMakeLists.txt diff --git a/source/tests/batch_import.py b/tests/python/batch_import.py similarity index 96% rename from source/tests/batch_import.py rename to tests/python/batch_import.py index a2c5fb59055..dea08b45c3a 100644 --- a/source/tests/batch_import.py +++ b/tests/python/batch_import.py @@ -21,21 +21,21 @@ """ Example Usage: -./blender.bin --background --python source/tests/batch_import.py -- \ +./blender.bin --background --python tests/python/batch_import.py -- \ --operator="bpy.ops.import_scene.obj" \ --path="/fe/obj" \ --match="*.obj" \ --start=0 --end=10 \ --save_path=/tmp/test -./blender.bin --background --python source/tests/batch_import.py -- \ +./blender.bin --background --python tests/python/batch_import.py -- \ --operator="bpy.ops.import_scene.autodesk_3ds" \ --path="/fe/" \ --match="*.3ds" \ --start=0 --end=1000 \ --save_path=/tmp/test -./blender.bin --background --addons io_curve_svg --python source/tests/batch_import.py -- \ +./blender.bin --background --addons io_curve_svg --python tests/python/batch_import.py -- \ --operator="bpy.ops.import_curve.svg" \ --path="/usr/" \ --match="*.svg" \ diff --git a/source/tests/bl_keymap_completeness.py b/tests/python/bl_keymap_completeness.py similarity index 100% rename from source/tests/bl_keymap_completeness.py rename to tests/python/bl_keymap_completeness.py diff --git a/source/tests/bl_load_addons.py b/tests/python/bl_load_addons.py similarity index 100% rename from source/tests/bl_load_addons.py rename to tests/python/bl_load_addons.py diff --git a/source/tests/bl_load_py_modules.py b/tests/python/bl_load_py_modules.py similarity index 100% rename from source/tests/bl_load_py_modules.py rename to tests/python/bl_load_py_modules.py diff --git a/source/tests/bl_mesh_modifiers.py b/tests/python/bl_mesh_modifiers.py similarity index 99% rename from source/tests/bl_mesh_modifiers.py rename to tests/python/bl_mesh_modifiers.py index 2f342f2c65e..b3f77aed96b 100644 --- a/source/tests/bl_mesh_modifiers.py +++ b/tests/python/bl_mesh_modifiers.py @@ -25,7 +25,7 @@ # Later, we may have a way to check the results are valid. -# ./blender.bin --factory-startup --python source/tests/bl_mesh_modifiers.py +# ./blender.bin --factory-startup --python tests/python/bl_mesh_modifiers.py # import math diff --git a/source/tests/bl_mesh_validate.py b/tests/python/bl_mesh_validate.py similarity index 100% rename from source/tests/bl_mesh_validate.py rename to tests/python/bl_mesh_validate.py diff --git a/source/tests/bl_pyapi_mathutils.py b/tests/python/bl_pyapi_mathutils.py similarity index 99% rename from source/tests/bl_pyapi_mathutils.py rename to tests/python/bl_pyapi_mathutils.py index c31244462cd..20312efcc02 100644 --- a/source/tests/bl_pyapi_mathutils.py +++ b/tests/python/bl_pyapi_mathutils.py @@ -1,4 +1,4 @@ -# ./blender.bin --background -noaudio --python source/tests/bl_pyapi_mathutils.py +# ./blender.bin --background -noaudio --python tests/python/bl_pyapi_mathutils.py import unittest from test import support from mathutils import Matrix, Vector diff --git a/source/tests/bl_pyapi_units.py b/tests/python/bl_pyapi_units.py similarity index 98% rename from source/tests/bl_pyapi_units.py rename to tests/python/bl_pyapi_units.py index 76b97ef00a1..a518b4e0caf 100644 --- a/source/tests/bl_pyapi_units.py +++ b/tests/python/bl_pyapi_units.py @@ -1,4 +1,4 @@ -# ./blender.bin --background -noaudio --python source/tests/bl_pyapi_units.py +# ./blender.bin --background -noaudio --python tests/python/bl_pyapi_units.py import unittest from test import support diff --git a/source/tests/bl_rna_wiki_reference.py b/tests/python/bl_rna_wiki_reference.py similarity index 98% rename from source/tests/bl_rna_wiki_reference.py rename to tests/python/bl_rna_wiki_reference.py index 8cb20aaf7f6..5781c53c045 100644 --- a/source/tests/bl_rna_wiki_reference.py +++ b/tests/python/bl_rna_wiki_reference.py @@ -19,7 +19,7 @@ # # Use for validating our wiki interlinking. -# ./blender.bin --background -noaudio --python source/tests/bl_rna_wiki_reference.py +# ./blender.bin --background -noaudio --python tests/python/bl_rna_wiki_reference.py # # 1) test_data() -- ensure the data we have is correct format # 2) test_lookup_coverage() -- ensure that we have lookups for _every_ RNA path diff --git a/source/tests/bl_rst_completeness.py b/tests/python/bl_rst_completeness.py similarity index 97% rename from source/tests/bl_rst_completeness.py rename to tests/python/bl_rst_completeness.py index 6e67f8d908d..d0ba2c552cf 100644 --- a/source/tests/bl_rst_completeness.py +++ b/tests/python/bl_rst_completeness.py @@ -20,11 +20,11 @@ # run this script in the game engine. # or on the command line with... -# ./blender.bin --background -noaudio --python source/tests/bl_rst_completeness.py +# ./blender.bin --background -noaudio --python tests/python/bl_rst_completeness.py # Paste this into the bge and run on an always actuator. ''' -filepath = "/dsk/data/src/blender/blender/source/tests/bl_rst_completeness.py" +filepath = "/src/blender/tests/python/bl_rst_completeness.py" exec(compile(open(filepath).read(), filepath, 'exec')) ''' diff --git a/source/tests/bl_run_operators.py b/tests/python/bl_run_operators.py similarity index 100% rename from source/tests/bl_run_operators.py rename to tests/python/bl_run_operators.py diff --git a/source/tests/bl_test.py b/tests/python/bl_test.py similarity index 100% rename from source/tests/bl_test.py rename to tests/python/bl_test.py diff --git a/source/tests/pep8.py b/tests/python/pep8.py similarity index 98% rename from source/tests/pep8.py rename to tests/python/pep8.py index cca49d54ac0..7713ffeaaa4 100644 --- a/source/tests/pep8.py +++ b/tests/python/pep8.py @@ -32,7 +32,7 @@ import os # in Debian install pylint pep8 with apt-get/aptitude/etc # # on *nix run -# python source/tests/pep8.py > test_pep8.log 2>&1 +# python tests/pep8.py > test_pep8.log 2>&1 # how many lines to read into the file, pep8 comment # should be directly after the license header, ~20 in most cases diff --git a/source/tests/rna_array.py b/tests/python/rna_array.py similarity index 100% rename from source/tests/rna_array.py rename to tests/python/rna_array.py diff --git a/source/tests/rna_info_dump.py b/tests/python/rna_info_dump.py similarity index 98% rename from source/tests/rna_info_dump.py rename to tests/python/rna_info_dump.py index 40d7b7c38a6..c26d94a1246 100644 --- a/source/tests/rna_info_dump.py +++ b/tests/python/rna_info_dump.py @@ -19,7 +19,7 @@ # # Used for generating API diffs between releases -# ./blender.bin --background -noaudio --python source/tests/rna_info_dump.py +# ./blender.bin --background -noaudio --python tests/python/rna_info_dump.py import bpy diff --git a/source/tests/rst_to_doctree_mini.py b/tests/python/rst_to_doctree_mini.py similarity index 100% rename from source/tests/rst_to_doctree_mini.py rename to tests/python/rst_to_doctree_mini.py