diff --git a/.appveyor.yml b/.appveyor.yml index 2a02c02aa0..7d527b64a6 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -148,11 +148,10 @@ before_build: build: off build_script: - - cd c:\projects\boost - - if NOT DEFINED GENERATOR b2 address-model=%AM% toolset=%TOOLSET% variant=%VARIANT% cxxstd=%CXXSTD% libs/gil/test - - if NOT DEFINED GENERATOR b2 address-model=%AM% toolset=%TOOLSET% variant=%VARIANT% cxxstd=%CXXSTD% libs/gil/toolbox/test - - if NOT DEFINED GENERATOR b2 address-model=%AM% toolset=%TOOLSET% variant=%VARIANT% cxxstd=%CXXSTD% libs/gil/numeric/test - - if NOT DEFINED GENERATOR b2 address-model=%AM% toolset=%TOOLSET% variant=%VARIANT% cxxstd=%CXXSTD% include=%VCPKG_I% library-path=%VCPKG_L% libs/gil/io/test//simple + - if NOT DEFINED GENERATOR b2 --abbreviate-paths address-model=%AM% toolset=%TOOLSET% variant=%VARIANT% cxxstd=%CXXSTD% libs/gil/test/core + - if NOT DEFINED GENERATOR b2 --abbreviate-paths address-model=%AM% toolset=%TOOLSET% variant=%VARIANT% cxxstd=%CXXSTD% libs/gil/test/extension/numeric + - if NOT DEFINED GENERATOR b2 --abbreviate-paths address-model=%AM% toolset=%TOOLSET% variant=%VARIANT% cxxstd=%CXXSTD% libs/gil/test/extension/toolbox + - if NOT DEFINED GENERATOR b2 --abbreviate-paths address-model=%AM% toolset=%TOOLSET% variant=%VARIANT% cxxstd=%CXXSTD% include=%VCPKG_I% library-path=%VCPKG_L% libs/gil/test/extension/io//simple - if DEFINED GENERATOR cd libs\gil && md build && cd build - if DEFINED GENERATOR cmake -G "%GENERATOR%" -DCMAKE_CXX_STANDARD=%CXXSTD% -DBoost_DETAILED_FAILURE_MSG=ON -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake .. - if DEFINED GENERATOR cmake --build . --config %CMAKE_CONFIG % diff --git a/.ci/build-and-test.sh b/.ci/build-and-test.sh index 8bbb4c60b3..7f50c12be2 100755 --- a/.ci/build-and-test.sh +++ b/.ci/build-and-test.sh @@ -38,7 +38,7 @@ fi echo "Running ./b2 -j $JOBS $B2_OPTIONS toolset=$TOOLSET variant=$VARIANT" set -euv -./b2 -j $JOBS $B2_OPTIONS toolset=$TOOLSET variant=$VARIANT cxxstd=$CXXSTD libs/gil/test -./b2 -j $JOBS $B2_OPTIONS toolset=$TOOLSET variant=$VARIANT cxxstd=$CXXSTD libs/gil/toolbox/test -./b2 -j $JOBS $B2_OPTIONS toolset=$TOOLSET variant=$VARIANT cxxstd=$CXXSTD libs/gil/numeric/test -./b2 -j $JOBS $B2_OPTIONS toolset=$TOOLSET variant=$VARIANT cxxstd=$CXXSTD libs/gil/io/test//simple +./b2 -j $JOBS $B2_OPTIONS toolset=$TOOLSET variant=$VARIANT cxxstd=$CXXSTD libs/gil/test/core +./b2 -j $JOBS $B2_OPTIONS toolset=$TOOLSET variant=$VARIANT cxxstd=$CXXSTD libs/gil/test/extension/numeric +./b2 -j $JOBS $B2_OPTIONS toolset=$TOOLSET variant=$VARIANT cxxstd=$CXXSTD libs/gil/test/extension/toolbox +./b2 -j $JOBS $B2_OPTIONS toolset=$TOOLSET variant=$VARIANT cxxstd=$CXXSTD libs/gil/test/extension/io//simple diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f3c8a7dbf..74131d2366 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -273,25 +273,25 @@ steps_test_core: &steps_test_core steps: - *attach_workspace - *run_compiler_version - - run: cd boost && ./b2 toolset=$TOOLSET $VARIANT $OPTIMIZ cxxstd="$CXXSTD" libs/gil/test + - run: cd boost-root && ./b2 toolset=$TOOLSET $VARIANT $OPTIMIZ cxxstd="$CXXSTD" libs/gil/test/core -steps_test_toolbox: &steps_test_toolbox +steps_test_numeric: &steps_test_numeric steps: - *attach_workspace - *run_compiler_version - - run: cd boost && ./b2 toolset=$TOOLSET $VARIANT $OPTIMIZ cxxstd="$CXXSTD" libs/gil/toolbox/test + - run: cd boost-root && ./b2 toolset=$TOOLSET $VARIANT $OPTIMIZ cxxstd="$CXXSTD" libs/gil/test/extension/numeric -steps_test_numeric: &steps_test_numeric +steps_test_toolbox: &steps_test_toolbox steps: - *attach_workspace - *run_compiler_version - - run: cd boost && ./b2 toolset=$TOOLSET $VARIANT $OPTIMIZ cxxstd="$CXXSTD" libs/gil/numeric/test + - run: cd boost-root && ./b2 toolset=$TOOLSET $VARIANT $OPTIMIZ cxxstd="$CXXSTD" libs/gil/test/extension/toolbox steps_test_io: &steps_test_io steps: - *attach_workspace - *run_compiler_version - - run: cd boost && ./b2 toolset=$TOOLSET $VARIANT $OPTIMIZ cxxstd="$CXXSTD" libs/gil/io/test//simple + - run: cd boost-root && ./b2 toolset=$TOOLSET $VARIANT $OPTIMIZ cxxstd="$CXXSTD" libs/gil/test/extension/io//simple ############################################################################## # Build jobs diff --git a/.travis.yml b/.travis.yml index 926c73dfea..17c4ff0454 100644 --- a/.travis.yml +++ b/.travis.yml @@ -130,11 +130,11 @@ matrix: - llvm-toolchain-precise-3.9 - os: linux - env: COMPILER=clang++-5.0 VARIANT=gil_ubsan_integer TOOLSET=clang CXXSTD=11 B2_OPTIONS="visibility=global" UBSAN_OPTIONS='print_stacktrace=1' + env: COMPILER=clang++-6.0 VARIANT=gil_ubsan_integer TOOLSET=clang CXXSTD=11 B2_OPTIONS="visibility=global" UBSAN_OPTIONS='print_stacktrace=1' addons: apt: packages: - - clang-5.0 + - clang-6.0 - libstdc++-7-dev - libpng-dev - libjpeg-dev @@ -142,14 +142,14 @@ matrix: - libraw-dev sources: - ubuntu-toolchain-r-test - - llvm-toolchain-trusty-5.0 + - llvm-toolchain-trusty-6.0 - os: linux - env: COMPILER=clang++-5.0 VARIANT=gil_ubsan_nullability TOOLSET=clang CXXSTD=11 B2_OPTIONS="visibility=global" UBSAN_OPTIONS='print_stacktrace=1' + env: COMPILER=clang++-6.0 VARIANT=gil_ubsan_nullability TOOLSET=clang CXXSTD=11 B2_OPTIONS="visibility=global" UBSAN_OPTIONS='print_stacktrace=1' addons: apt: packages: - - clang-5.0 + - clang-6.0 - libstdc++-7-dev - libpng-dev - libjpeg-dev @@ -157,14 +157,13 @@ matrix: - libraw-dev sources: - ubuntu-toolchain-r-test - - llvm-toolchain-trusty-5.0 - os: linux - env: COMPILER=clang++-5.0 VARIANT=gil_ubsan_undefined TOOLSET=clang CXXSTD=11 B2_OPTIONS="visibility=global" UBSAN_OPTIONS='print_stacktrace=1' + env: COMPILER=clang++-6.0 VARIANT=gil_ubsan_undefined TOOLSET=clang CXXSTD=11 B2_OPTIONS="visibility=global" UBSAN_OPTIONS='print_stacktrace=1' addons: apt: packages: - - clang-5.0 + - clang-6.0 - libstdc++-7-dev - libpng-dev - libjpeg-dev @@ -172,7 +171,6 @@ matrix: - libraw-dev sources: - ubuntu-toolchain-r-test - - llvm-toolchain-trusty-5.0 - os: osx env: COMPILER=clang++ VARIANT=debug TOOLSET=clang CXXSTD=11 @@ -187,7 +185,7 @@ matrix: - doxygen allow_failures: - - env: COMPILER=clang++-5.0 VARIANT=gil_ubsan_integer TOOLSET=clang CXXSTD=11 B2_OPTIONS="visibility=global" UBSAN_OPTIONS='print_stacktrace=1' + - env: COMPILER=clang++-6.0 VARIANT=gil_ubsan_integer TOOLSET=clang CXXSTD=11 B2_OPTIONS="visibility=global" UBSAN_OPTIONS='print_stacktrace=1' install: - |- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d5c5709f1..4196bfcff1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.10) # Options #----------------------------------------------------------------------------- option(GIL_BUILD_EXAMPLES "Build examples" ON) -option(GIL_BUILD_HEADERS_TESTS "Enable self-contained header tests" ON) +option(GIL_BUILD_HEADER_TESTS "Enable self-contained header tests" ON) option(GIL_ENABLE_EXT_IO "Enable IO extension, tests and examples (require libjpeg, libpng, libtiff)" ON) option(GIL_ENABLE_EXT_NUMERIC "Enable Numeric extension, tests and examples" ON) option(GIL_ENABLE_EXT_TOOLBOX "Enable Toolbox extension, tests and examples" ON) @@ -264,21 +264,10 @@ enable_testing() # On Boost regression builds, CMake does not run, but Boost.Build, # so the header tests are not enabled there either. if(DEFINED ENV{CI}) - set(GIL_BUILD_HEADERS_TESTS OFF) -endif() -add_subdirectory(test) - -if(GIL_ENABLE_EXT_IO) - add_subdirectory(io/test) + set(GIL_BUILD_HEADER_TESTS OFF) endif() -if(GIL_ENABLE_EXT_NUMERIC) - add_subdirectory(numeric/test) -endif() - -if(GIL_ENABLE_EXT_TOOLBOX) - add_subdirectory(toolbox/test) -endif() +add_subdirectory(test) #----------------------------------------------------------------------------- # Examples diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e0fdccf4a..dab36cdca7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -308,21 +308,21 @@ Run core tests only specifying location of directory with tests: ```shell cd libs/gil -../../b2 -j8 test +../../b2 -j8 test/core ``` Run all tests for selected extension (from Boost root directory, as alternative): ```shell -./b2 -j8 libs/gil/io/test -./b2 -j8 libs/gil/numeric/test -./b2 -j8 libs/gil/toolbox/test +./b2 -j8 libs/gil/test/io +./b2 -j8 libs/gil/test/numeric +./b2 -j8 libs/gil/test/toolbox ``` Run I/O extension tests bundled in target called `simple`: ```shell -./b2 libs/gil/io/test//simple +./b2 libs/gil/test/io//simple ``` *TODO:* _Explain I/O dependencies (libjpeg, etc.)_ diff --git a/Jamfile b/Jamfile index ceece4e309..0914294b50 100644 --- a/Jamfile +++ b/Jamfile @@ -1,80 +1,10 @@ -# Boost.GIL (Generic Image Library) +# Boost.Assign Library Jamfile # -# Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) -# Copyright (c) 2018-2019 Mateusz Loskot +# Copyright (c) 2018 James E. King III # -# Use, modification and distribution is subject to the Boost Software License, -# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -import ../config/checks/config : requires ; -import os ; - -# Avoid warnings flood on Travis CI, AppVeyor, CircleCI, Azure Pipelines -if ! [ os.environ CI ] && ! [ os.environ AGENT_JOBSTATUS ] -{ - DEVELOPMENT_EXTRA_WARNINGS = - msvc:/W4 - gcc:"-pedantic -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter" - clang,debug:"-pedantic -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter -Wsign-conversion" - clang,release:"-pedantic -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter -Wsign-conversion" - darwin:"-pedantic -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter" - ; -} - -project - : - requirements - msvc:on - msvc:/bigobj - msvc:_SCL_SECURE_NO_DEPRECATE - msvc:_CRT_SECURE_NO_WARNINGS - msvc:_CRT_NONSTDC_NO_DEPRECATE - msvc:NOMINMAX - intel:off - gcc:"-fstrict-aliasing -Wextra" - darwin:"-fstrict-aliasing -Wextra" - # variant filter for clang is necessary to allow ubsan_* variants declare distinct set of - clang,debug:"-fstrict-aliasing -Wextra" - clang,release:"-fstrict-aliasing -Wextra" - $(DEVELOPMENT_EXTRA_WARNINGS) - [ requires - cxx11_constexpr - cxx11_defaulted_functions - cxx11_template_aliases - cxx11_trailing_result_types # implies decltype and auto - cxx11_variadic_templates - ] - ; - -variant gil_ubsan_integer - : release - : - "-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=integer -fno-sanitize-recover=integer -fsanitize-blacklist=libs/gil/.ci/blacklist.supp" - "-fsanitize=integer" - on - BOOST_USE_ASAN=1 - ; - -variant gil_ubsan_nullability - : release - : - "-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=nullability -fno-sanitize-recover=nullability -fsanitize-blacklist=libs/gil/.ci/blacklist.supp" - "-fsanitize=nullability" - on - BOOST_USE_ASAN=1 - ; - -variant gil_ubsan_undefined - : release - : - "-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-blacklist=libs/gil/.ci/blacklist.supp" - "-fsanitize=undefined" - on - BOOST_USE_ASAN=1 - ; +# Use, modification, and distribution are subject to the +# Boost Software License, Version 1.0. (See accompanying file +# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +# please order by name to ease maintenance build-project test ; -build-project numeric/test ; -build-project toolbox/test ; -build-project io/test ; diff --git a/doc/io.rst b/doc/io.rst index f107b251cd..9554e8712c 100644 --- a/doc/io.rst +++ b/doc/io.rst @@ -267,7 +267,7 @@ The following code sample shows the usage:: , tag_t > reader_t; - reader_t reader = make_scanline_reader( "C:/boost/libs/gil/io/test_images/tiff/test.tif", tag_t() ); + reader_t reader = make_scanline_reader( "C:/boost/libs/gil/test/extension/io/images/tiff/test.tif", tag_t() ); typedef rgba8_image_t image_t; diff --git a/example/cmake/CMakeSettings.json b/example/cmake/CMakeSettings.json index b5f32bd6a6..57607db093 100644 --- a/example/cmake/CMakeSettings.json +++ b/example/cmake/CMakeSettings.json @@ -20,11 +20,12 @@ "ctestCommandArgs": "", "variables": [ { "name": "Boost_ARCHITECTURE", "value": "-x64" }, - { "name": "GIL_ENABLE_EXT_IO", "value": "OFF" }, - { "name": "GIL_ENABLE_EXT_NUMERIC", "value": "OFF" }, - { "name": "GIL_ENABLE_EXT_TOOLBOX", "value": "OFF" }, - { "name": "GIL_BUILD_EXAMPLES", "value": "OFF" }, - { "name": "GIL_BUILD_HEADERS_TESTS", "value": "OFF" }, + { "name": "Boost_COMPILER", "value": "-vc142;-vc141" }, + { "name": "GIL_ENABLE_EXT_IO", "value": "ON" }, + { "name": "GIL_ENABLE_EXT_NUMERIC", "value": "ON" }, + { "name": "GIL_ENABLE_EXT_TOOLBOX", "value": "ON" }, + { "name": "GIL_BUILD_EXAMPLES", "value": "ON" }, + { "name": "GIL_BUILD_HEADER_TESTS", "value": "OFF" }, { "name": "GIL_DOWNLOAD_FINDBOOST", "value": "ON" }, { "name": "GIL_USE_CONAN", "value": "ON" } ] @@ -45,7 +46,7 @@ { "name": "GIL_ENABLE_EXT_NUMERIC", "value": "OFF" }, { "name": "GIL_ENABLE_EXT_TOOLBOX", "value": "OFF" }, { "name": "GIL_BUILD_EXAMPLES", "value": "OFF" }, - { "name": "GIL_BUILD_HEADERS_TESTS", "value": "OFF" }, + { "name": "GIL_BUILD_HEADER_TESTS", "value": "OFF" }, { "name": "GIL_DOWNLOAD_FINDBOOST", "value": "ON" }, { "name": "GIL_USE_CONAN", "value": "ON" } ] @@ -61,11 +62,15 @@ "buildCommandArgs": "-v", "ctestCommandArgs": "", "variables": [ - { "name": "GIL_ENABLE_EXT_IO", "value": "OFF" }, - { "name": "GIL_ENABLE_EXT_NUMERIC", "value": "OFF" }, - { "name": "GIL_ENABLE_EXT_TOOLBOX", "value": "OFF" }, - { "name": "GIL_BUILD_EXAMPLES", "value": "OFF" }, - { "name": "GIL_BUILD_HEADERS_TESTS", "value": "OFF" }, + { "name": "Boost_DEBUG", "value": "ON" }, + { "name": "Boost_ADDITIONAL_VERSIONS", "value": "1.71" }, + { "name": "Boost_ARCHITECTURE", "value": "-x32" }, + { "name": "Boost_COMPILER", "value": "-vc142;-vc141" }, + { "name": "GIL_ENABLE_EXT_IO", "value": "ON" }, + { "name": "GIL_ENABLE_EXT_NUMERIC", "value": "ON" }, + { "name": "GIL_ENABLE_EXT_TOOLBOX", "value": "ON" }, + { "name": "GIL_BUILD_EXAMPLES", "value": "ON" }, + { "name": "GIL_BUILD_HEADER_TESTS", "value": "ON" }, { "name": "GIL_DOWNLOAD_FINDBOOST", "value": "ON" }, { "name": "GIL_USE_CONAN", "value": "ON" } ] @@ -81,11 +86,15 @@ "buildCommandArgs": "-v", "ctestCommandArgs": "", "variables": [ - { "name": "GIL_ENABLE_EXT_IO", "value": "OFF" }, - { "name": "GIL_ENABLE_EXT_NUMERIC", "value": "OFF" }, - { "name": "GIL_ENABLE_EXT_TOOLBOX", "value": "OFF" }, - { "name": "GIL_BUILD_EXAMPLES", "value": "OFF" }, - { "name": "GIL_BUILD_HEADERS_TESTS", "value": "OFF" }, + { "name": "Boost_DEBUG", "value": "ON" }, + { "name": "Boost_ADDITIONAL_VERSIONS", "value": "1.71" }, + { "name": "Boost_ARCHITECTURE", "value": "-x32" }, + { "name": "Boost_COMPILER", "value": "-vc142;-vc141" }, + { "name": "GIL_ENABLE_EXT_IO", "value": "ON" }, + { "name": "GIL_ENABLE_EXT_NUMERIC", "value": "ON" }, + { "name": "GIL_ENABLE_EXT_TOOLBOX", "value": "ON" }, + { "name": "GIL_BUILD_EXAMPLES", "value": "ON" }, + { "name": "GIL_BUILD_HEADER_TESTS", "value": "ON" }, { "name": "GIL_DOWNLOAD_FINDBOOST", "value": "ON" }, { "name": "GIL_USE_CONAN", "value": "ON" } ] diff --git a/io/index.html b/io/index.html deleted file mode 100644 index 27e6a896ce..0000000000 --- a/io/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - -Automatic redirection failed, please go to -doc/html/index.html - - diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e75d50512a..2934673f70 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,41 +1,18 @@ # -# Copyright (c) 2017-2019 Mateusz Loskot +# Copyright (c) 2019 Mateusz Loskot # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # -message(STATUS "Boost.GIL: Configuring core tests") +add_subdirectory(core) -foreach(_name - promote_integral) - set(_target utility_${_name}) - - add_executable(${_target} "") - target_sources(${_target} PRIVATE ${_name}.cpp) - target_link_libraries(${_target} - PRIVATE - gil_compile_options - gil_include_directories - gil_dependencies) - target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) - add_test(test.utility.${_name} ${_target}) +add_subdirectory(legacy) - unset(_target) - unset(_name) -endforeach() +add_subdirectory(extension) -if(GIL_BUILD_HEADERS_TESTS) - add_subdirectory(headers) -endif() +# TODO: Split headers tests into core and extensions, see Jamfile-s +# if(GIL_BUILD_HEADERS_TESTS) +# add_subdirectory(headers) +# endif() -add_subdirectory(point) -add_subdirectory(channel) -add_subdirectory(color) -add_subdirectory(pixel) -add_subdirectory(iterator) -add_subdirectory(locator) -add_subdirectory(image) -add_subdirectory(image_view) -add_subdirectory(algorithm) -add_subdirectory(legacy) diff --git a/test/Jamfile b/test/Jamfile index 31aa72dffb..5f66d78bc5 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -1,31 +1,119 @@ # Boost.GIL (Generic Image Library) - tests # -# Copyright (c) 2007-2015 Andrey Semashev -# Copyright (c) 2008 Lubomir Bourdev, Hailin Jin +# Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) # Copyright (c) 2018-2019 Mateusz Loskot # Copyright (c) 2018 Dmitry Arkhipov +# Copyright (c) 2007-2015 Andrey Semashev # -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or -# copy at http://www.boost.org/LICENSE_1_0.txt) +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +import ../../config/checks/config : requires ; +import os ; +import path ; +import regex ; import testing ; +# Avoid warnings flood on Travis CI, AppVeyor, CircleCI, Azure Pipelines +if ! [ os.environ CI ] && ! [ os.environ AGENT_JOBSTATUS ] +{ + DEVELOPMENT_EXTRA_WARNINGS = + msvc:/W4 + gcc:"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter" + clang,debug:"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter -Wsign-conversion" + clang,release:"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter -Wsign-conversion" + darwin:"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter" + ; +} + project - : requirements + : + requirements . - BOOST_GIL_USE_CONCEPT_CHECK + # TODO: Enable concepts check for all, not just test/core + #BOOST_GIL_USE_CONCEPT_CHECK=1 + msvc:on + msvc:/bigobj + msvc:_SCL_SECURE_NO_DEPRECATE + msvc:_CRT_SECURE_NO_WARNINGS + msvc:_CRT_NONSTDC_NO_DEPRECATE + msvc:NOMINMAX + intel:off + gcc:"-fstrict-aliasing" + darwin:"-fstrict-aliasing" + # variant filter for clang is necessary to allow ubsan_* + # custom variants declare distinct set of + clang,debug:"-fstrict-aliasing" + clang,release:"-fstrict-aliasing" + $(DEVELOPMENT_EXTRA_WARNINGS) + [ requires + cxx11_constexpr + cxx11_defaulted_functions + cxx11_template_aliases + cxx11_trailing_result_types # implies decltype and auto + cxx11_variadic_templates + ] ; -build-project point ; -build-project channel ; -build-project color ; -build-project pixel ; -build-project iterator ; -build-project locator ; -build-project image ; -build-project image_view ; -build-project algorithm ; -build-project legacy ; +variant gil_ubsan_integer + : release + : + "-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=integer -fno-sanitize-recover=integer -fsanitize-blacklist=libs/gil/.ci/blacklist.supp" + "-fsanitize=integer" + on + BOOST_USE_ASAN=1 + ; + +variant gil_ubsan_nullability + : release + : + "-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=nullability -fno-sanitize-recover=nullability -fsanitize-blacklist=libs/gil/.ci/blacklist.supp" + "-fsanitize=nullability" + on + BOOST_USE_ASAN=1 + ; + +variant gil_ubsan_undefined + : release + : + "-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-blacklist=libs/gil/.ci/blacklist.supp" + "-fsanitize=undefined" + on + BOOST_USE_ASAN=1 + ; + +rule generate_self_contained_headers ( headers_subpath * : exclude_subpaths * ) +{ + # On CI services, test the self-contained headers on-demand only to avoid build timeouts + # CI environment is common for Travis CI, AppVeyor, CircleCI, etc. + # For example: + # if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ] { + # alias self_contained_headers : [ generate_self_contained_headers ] ; + # } -run promote_integral.cpp /boost/test//boost_unit_test_framework : : : shared:BOOST_TEST_DYN_LINK=1 ; + local targets ; + + # NOTE: All '/' in test names are replaced with '-' because apparently + # test scripts have a problem with test names containing slashes. + + local top_headers_path = [ path.make $(BOOST_ROOT)/libs/gil/include/boost/gil ] ; + + for local file in [ path.glob-tree $(top_headers_path)/$(headers_subpath) : *.hpp : $(exclude_subpaths) ] + { + local rel_file = [ path.relative-to $(top_headers_path) $(file) ] ; + local target_name = [ regex.replace h/$(rel_file) "/" "-" ] ; + local target_name = [ regex.replace $(target_name) "\.hpp" "" ] ; + targets += [ + compile $(BOOST_ROOT)/libs/gil/test/header/main.cpp + : "BOOST_GIL_TEST_HEADER=$(rel_file)" $(file) + : $(target_name) + ] ; + } + + return $(targets) ; +} + +build-project core ; +build-project legacy ; +build-project extension ; diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt new file mode 100644 index 0000000000..0556975309 --- /dev/null +++ b/test/core/CMakeLists.txt @@ -0,0 +1,38 @@ +# +# Copyright (c) 2017-2019 Mateusz Loskot +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# +message(STATUS "Boost.GIL: Configuring tests in test/core") + +foreach(_name + promote_integral) + set(_test t_utility_${_name}) + set(_target test_utility_${_name}) + + add_executable(${_target} "") + target_sources(${_target} PRIVATE ${_name}.cpp) + target_link_libraries(${_target} + PRIVATE + gil_compile_options + gil_include_directories + gil_dependencies) + target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) + add_test(NAME ${_test} COMMAND ${_target}) + + unset(_name) + unset(_target) + unset(_test) +endforeach() + +add_subdirectory(point) +add_subdirectory(channel) +add_subdirectory(color) +add_subdirectory(pixel) +add_subdirectory(iterator) +add_subdirectory(locator) +add_subdirectory(image) +add_subdirectory(image_view) +add_subdirectory(algorithm) diff --git a/test/core/Jamfile b/test/core/Jamfile new file mode 100644 index 0000000000..a8aa7f8f87 --- /dev/null +++ b/test/core/Jamfile @@ -0,0 +1,31 @@ +# Boost.GIL (Generic Image Library) - core tests +# +# Copyright (c) 2008 Lubomir Bourdev, Hailin Jin +# Copyright (c) 2018-2019 Mateusz Loskot +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or +# copy at http://www.boost.org/LICENSE_1_0.txt) + +import testing ; + +project + : + requirements + BOOST_GIL_USE_CONCEPT_CHECK=1 + ; + +alias headers_concepts : [ generate_self_contained_headers concepts ] ; +alias headers : [ generate_self_contained_headers : concepts extension io ] ; + +build-project point ; +build-project channel ; +build-project color ; +build-project pixel ; +build-project iterator ; +build-project locator ; +build-project image ; +build-project image_view ; +build-project algorithm ; + +run promote_integral.cpp /boost/test//boost_unit_test_framework : : : shared:BOOST_TEST_DYN_LINK=1 ; diff --git a/test/algorithm/CMakeLists.txt b/test/core/algorithm/CMakeLists.txt similarity index 100% rename from test/algorithm/CMakeLists.txt rename to test/core/algorithm/CMakeLists.txt diff --git a/test/algorithm/Jamfile b/test/core/algorithm/Jamfile similarity index 100% rename from test/algorithm/Jamfile rename to test/core/algorithm/Jamfile diff --git a/test/algorithm/for_each_pixel.cpp b/test/core/algorithm/for_each_pixel.cpp similarity index 100% rename from test/algorithm/for_each_pixel.cpp rename to test/core/algorithm/for_each_pixel.cpp diff --git a/test/algorithm/std_fill.cpp b/test/core/algorithm/std_fill.cpp similarity index 100% rename from test/algorithm/std_fill.cpp rename to test/core/algorithm/std_fill.cpp diff --git a/test/channel/CMakeLists.txt b/test/core/channel/CMakeLists.txt similarity index 97% rename from test/channel/CMakeLists.txt rename to test/core/channel/CMakeLists.txt index 635c5e8925..616ffa433b 100644 --- a/test/channel/CMakeLists.txt +++ b/test/core/channel/CMakeLists.txt @@ -13,7 +13,7 @@ foreach(_name algorithm_channel_relation channel_traits concepts - is_integral + is_channel_integral packed_channel_value scoped_channel_value test_fixture) diff --git a/test/channel/Jamfile b/test/core/channel/Jamfile similarity index 96% rename from test/channel/Jamfile rename to test/core/channel/Jamfile index 2f75a5bd73..4305cefea5 100644 --- a/test/channel/Jamfile +++ b/test/core/channel/Jamfile @@ -17,7 +17,7 @@ project compile concepts.cpp ; run test_fixture.cpp ; -run is_integral.cpp ; +run is_channel_integral.cpp ; run channel_traits.cpp ; run packed_channel_value.cpp ; run scoped_channel_value.cpp ; diff --git a/test/channel/TODO.md b/test/core/channel/TODO.md similarity index 100% rename from test/channel/TODO.md rename to test/core/channel/TODO.md diff --git a/test/channel/algorithm_channel_arithmetic.cpp b/test/core/channel/algorithm_channel_arithmetic.cpp similarity index 100% rename from test/channel/algorithm_channel_arithmetic.cpp rename to test/core/channel/algorithm_channel_arithmetic.cpp diff --git a/test/channel/algorithm_channel_convert.cpp b/test/core/channel/algorithm_channel_convert.cpp similarity index 100% rename from test/channel/algorithm_channel_convert.cpp rename to test/core/channel/algorithm_channel_convert.cpp diff --git a/test/channel/algorithm_channel_invert.cpp b/test/core/channel/algorithm_channel_invert.cpp similarity index 100% rename from test/channel/algorithm_channel_invert.cpp rename to test/core/channel/algorithm_channel_invert.cpp diff --git a/test/channel/algorithm_channel_multiply.cpp b/test/core/channel/algorithm_channel_multiply.cpp similarity index 100% rename from test/channel/algorithm_channel_multiply.cpp rename to test/core/channel/algorithm_channel_multiply.cpp diff --git a/test/channel/algorithm_channel_relation.cpp b/test/core/channel/algorithm_channel_relation.cpp similarity index 100% rename from test/channel/algorithm_channel_relation.cpp rename to test/core/channel/algorithm_channel_relation.cpp diff --git a/test/channel/channel_traits.cpp b/test/core/channel/channel_traits.cpp similarity index 100% rename from test/channel/channel_traits.cpp rename to test/core/channel/channel_traits.cpp diff --git a/test/channel/concepts.cpp b/test/core/channel/concepts.cpp similarity index 100% rename from test/channel/concepts.cpp rename to test/core/channel/concepts.cpp diff --git a/test/channel/is_integral.cpp b/test/core/channel/is_channel_integral.cpp similarity index 100% rename from test/channel/is_integral.cpp rename to test/core/channel/is_channel_integral.cpp diff --git a/test/channel/packed_channel_value.cpp b/test/core/channel/packed_channel_value.cpp similarity index 100% rename from test/channel/packed_channel_value.cpp rename to test/core/channel/packed_channel_value.cpp diff --git a/test/channel/scoped_channel_value.cpp b/test/core/channel/scoped_channel_value.cpp similarity index 100% rename from test/channel/scoped_channel_value.cpp rename to test/core/channel/scoped_channel_value.cpp diff --git a/test/channel/test_fixture.cpp b/test/core/channel/test_fixture.cpp similarity index 100% rename from test/channel/test_fixture.cpp rename to test/core/channel/test_fixture.cpp diff --git a/test/channel/test_fixture.hpp b/test/core/channel/test_fixture.hpp similarity index 100% rename from test/channel/test_fixture.hpp rename to test/core/channel/test_fixture.hpp diff --git a/test/color/CMakeLists.txt b/test/core/color/CMakeLists.txt similarity index 100% rename from test/color/CMakeLists.txt rename to test/core/color/CMakeLists.txt diff --git a/test/color/Jamfile b/test/core/color/Jamfile similarity index 100% rename from test/color/Jamfile rename to test/core/color/Jamfile diff --git a/test/color/color_spaces_are_compatible.cpp b/test/core/color/color_spaces_are_compatible.cpp similarity index 100% rename from test/color/color_spaces_are_compatible.cpp rename to test/core/color/color_spaces_are_compatible.cpp diff --git a/test/color/concepts.cpp b/test/core/color/concepts.cpp similarity index 100% rename from test/color/concepts.cpp rename to test/core/color/concepts.cpp diff --git a/test/fabscript b/test/core/fabscript similarity index 100% rename from test/fabscript rename to test/core/fabscript diff --git a/test/image/CMakeLists.txt b/test/core/image/CMakeLists.txt similarity index 100% rename from test/image/CMakeLists.txt rename to test/core/image/CMakeLists.txt diff --git a/test/image/Jamfile b/test/core/image/Jamfile similarity index 100% rename from test/image/Jamfile rename to test/core/image/Jamfile diff --git a/test/image/concepts.cpp b/test/core/image/concepts.cpp similarity index 100% rename from test/image/concepts.cpp rename to test/core/image/concepts.cpp diff --git a/test/image_view/CMakeLists.txt b/test/core/image_view/CMakeLists.txt similarity index 100% rename from test/image_view/CMakeLists.txt rename to test/core/image_view/CMakeLists.txt diff --git a/test/image_view/Jamfile b/test/core/image_view/Jamfile similarity index 100% rename from test/image_view/Jamfile rename to test/core/image_view/Jamfile diff --git a/test/image_view/collection.cpp b/test/core/image_view/collection.cpp similarity index 100% rename from test/image_view/collection.cpp rename to test/core/image_view/collection.cpp diff --git a/test/image_view/concepts.cpp b/test/core/image_view/concepts.cpp similarity index 100% rename from test/image_view/concepts.cpp rename to test/core/image_view/concepts.cpp diff --git a/test/image_view/derived_view_type.cpp b/test/core/image_view/derived_view_type.cpp similarity index 100% rename from test/image_view/derived_view_type.cpp rename to test/core/image_view/derived_view_type.cpp diff --git a/test/image_view/dynamic_step.cpp b/test/core/image_view/dynamic_step.cpp similarity index 100% rename from test/image_view/dynamic_step.cpp rename to test/core/image_view/dynamic_step.cpp diff --git a/test/image_view/is_planar.cpp b/test/core/image_view/is_planar.cpp similarity index 100% rename from test/image_view/is_planar.cpp rename to test/core/image_view/is_planar.cpp diff --git a/test/image_view/view_is_basic.cpp b/test/core/image_view/view_is_basic.cpp similarity index 100% rename from test/image_view/view_is_basic.cpp rename to test/core/image_view/view_is_basic.cpp diff --git a/test/image_view/view_is_mutable.cpp b/test/core/image_view/view_is_mutable.cpp similarity index 100% rename from test/image_view/view_is_mutable.cpp rename to test/core/image_view/view_is_mutable.cpp diff --git a/test/image_view/view_is_step.cpp b/test/core/image_view/view_is_step.cpp similarity index 100% rename from test/image_view/view_is_step.cpp rename to test/core/image_view/view_is_step.cpp diff --git a/test/image_view/view_type.cpp b/test/core/image_view/view_type.cpp similarity index 100% rename from test/image_view/view_type.cpp rename to test/core/image_view/view_type.cpp diff --git a/test/image_view/view_type_from_pixel.cpp b/test/core/image_view/view_type_from_pixel.cpp similarity index 100% rename from test/image_view/view_type_from_pixel.cpp rename to test/core/image_view/view_type_from_pixel.cpp diff --git a/test/iterator/CMakeLists.txt b/test/core/iterator/CMakeLists.txt similarity index 100% rename from test/iterator/CMakeLists.txt rename to test/core/iterator/CMakeLists.txt diff --git a/test/iterator/Jamfile b/test/core/iterator/Jamfile similarity index 100% rename from test/iterator/Jamfile rename to test/core/iterator/Jamfile diff --git a/test/iterator/concepts.cpp b/test/core/iterator/concepts.cpp similarity index 100% rename from test/iterator/concepts.cpp rename to test/core/iterator/concepts.cpp diff --git a/test/iterator/dynamic_step.cpp b/test/core/iterator/dynamic_step.cpp similarity index 100% rename from test/iterator/dynamic_step.cpp rename to test/core/iterator/dynamic_step.cpp diff --git a/test/iterator/is_planar.cpp b/test/core/iterator/is_planar.cpp similarity index 100% rename from test/iterator/is_planar.cpp rename to test/core/iterator/is_planar.cpp diff --git a/test/locator/CMakeLists.txt b/test/core/locator/CMakeLists.txt similarity index 100% rename from test/locator/CMakeLists.txt rename to test/core/locator/CMakeLists.txt diff --git a/test/locator/Jamfile b/test/core/locator/Jamfile similarity index 100% rename from test/locator/Jamfile rename to test/core/locator/Jamfile diff --git a/test/locator/concepts.cpp b/test/core/locator/concepts.cpp similarity index 100% rename from test/locator/concepts.cpp rename to test/core/locator/concepts.cpp diff --git a/test/locator/dynamic_step.cpp b/test/core/locator/dynamic_step.cpp similarity index 100% rename from test/locator/dynamic_step.cpp rename to test/core/locator/dynamic_step.cpp diff --git a/test/pixel/CMakeLists.txt b/test/core/pixel/CMakeLists.txt similarity index 100% rename from test/pixel/CMakeLists.txt rename to test/core/pixel/CMakeLists.txt diff --git a/test/pixel/Jamfile b/test/core/pixel/Jamfile similarity index 100% rename from test/pixel/Jamfile rename to test/core/pixel/Jamfile diff --git a/test/pixel/bit_aligned_pixel_reference.cpp b/test/core/pixel/bit_aligned_pixel_reference.cpp similarity index 100% rename from test/pixel/bit_aligned_pixel_reference.cpp rename to test/core/pixel/bit_aligned_pixel_reference.cpp diff --git a/test/pixel/concepts.cpp b/test/core/pixel/concepts.cpp similarity index 100% rename from test/pixel/concepts.cpp rename to test/core/pixel/concepts.cpp diff --git a/test/pixel/is_pixel.cpp b/test/core/pixel/is_pixel.cpp similarity index 100% rename from test/pixel/is_pixel.cpp rename to test/core/pixel/is_pixel.cpp diff --git a/test/pixel/is_planar.cpp b/test/core/pixel/is_planar.cpp similarity index 100% rename from test/pixel/is_planar.cpp rename to test/core/pixel/is_planar.cpp diff --git a/test/pixel/num_channels.cpp b/test/core/pixel/num_channels.cpp similarity index 100% rename from test/pixel/num_channels.cpp rename to test/core/pixel/num_channels.cpp diff --git a/test/pixel/packed_pixel.cpp b/test/core/pixel/packed_pixel.cpp similarity index 100% rename from test/pixel/packed_pixel.cpp rename to test/core/pixel/packed_pixel.cpp diff --git a/test/pixel/pixel_reference_is_mutable.cpp b/test/core/pixel/pixel_reference_is_mutable.cpp similarity index 100% rename from test/pixel/pixel_reference_is_mutable.cpp rename to test/core/pixel/pixel_reference_is_mutable.cpp diff --git a/test/pixel/pixels_are_compatible.cpp b/test/core/pixel/pixels_are_compatible.cpp similarity index 100% rename from test/pixel/pixels_are_compatible.cpp rename to test/core/pixel/pixels_are_compatible.cpp diff --git a/test/pixel/test_fixture.cpp b/test/core/pixel/test_fixture.cpp similarity index 100% rename from test/pixel/test_fixture.cpp rename to test/core/pixel/test_fixture.cpp diff --git a/test/pixel/test_fixture.hpp b/test/core/pixel/test_fixture.hpp similarity index 100% rename from test/pixel/test_fixture.hpp rename to test/core/pixel/test_fixture.hpp diff --git a/test/point/CMakeLists.txt b/test/core/point/CMakeLists.txt similarity index 100% rename from test/point/CMakeLists.txt rename to test/core/point/CMakeLists.txt diff --git a/test/point/Jamfile b/test/core/point/Jamfile similarity index 100% rename from test/point/Jamfile rename to test/core/point/Jamfile diff --git a/test/point/concepts.cpp b/test/core/point/concepts.cpp similarity index 100% rename from test/point/concepts.cpp rename to test/core/point/concepts.cpp diff --git a/test/core/point/multiply_by_non_arithmetic_fail.cpp b/test/core/point/multiply_by_non_arithmetic_fail.cpp new file mode 100644 index 0000000000..b5c7031098 --- /dev/null +++ b/test/core/point/multiply_by_non_arithmetic_fail.cpp @@ -0,0 +1,23 @@ +// +// Copyright 2018 Mateusz Loskot +// +// Distributed under the Boost Software License, Version 1.0 +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +// +#include + +#include + +namespace gil = boost::gil; + +struct FakeMatrix {}; + +int main() +{ + gil::point p1{2, 4}; + + FakeMatrix m1; + auto r1 = p1 * m1; + auto r2 = m1 * p1; +} diff --git a/test/point/point.cpp b/test/core/point/point.cpp similarity index 100% rename from test/point/point.cpp rename to test/core/point/point.cpp diff --git a/test/promote_integral.cpp b/test/core/promote_integral.cpp similarity index 100% rename from test/promote_integral.cpp rename to test/core/promote_integral.cpp diff --git a/test/extension/CMakeLists.txt b/test/extension/CMakeLists.txt new file mode 100644 index 0000000000..1fc7076a8e --- /dev/null +++ b/test/extension/CMakeLists.txt @@ -0,0 +1,18 @@ +# +# Copyright (c) 2019 Mateusz Loskot +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# +if(GIL_ENABLE_EXT_NUMERIC) + add_subdirectory(numeric) +endif() + +if(GIL_ENABLE_EXT_TOOLBOX) + add_subdirectory(toolbox) +endif() + +if(GIL_ENABLE_EXT_IO) + add_subdirectory(io) +endif() diff --git a/test/extension/Jamfile b/test/extension/Jamfile new file mode 100644 index 0000000000..cf9ef40896 --- /dev/null +++ b/test/extension/Jamfile @@ -0,0 +1,12 @@ +# Boost.GIL (Generic Image Library) - extensions tests +# +# Copyright (c) 2019 Mateusz Loskot +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or +# copy at http://www.boost.org/LICENSE_1_0.txt) + +build-project dynamic_image ; +build-project numeric ; +build-project toolbox ; +build-project io ; diff --git a/test/extension/dynamic_image/Jamfile b/test/extension/dynamic_image/Jamfile new file mode 100644 index 0000000000..bc2082f43d --- /dev/null +++ b/test/extension/dynamic_image/Jamfile @@ -0,0 +1,11 @@ +# Boost.GIL (Generic Image Library) - dynamic_image tests +# +# Copyright (c) 2019 Mateusz Loskot +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or +# copy at http://www.boost.org/LICENSE_1_0.txt) + +import testing ; + +alias headers : [ generate_self_contained_headers extension/dynamic_image ] ; diff --git a/test/extension/io/.gitignore b/test/extension/io/.gitignore new file mode 100644 index 0000000000..16be8f2193 --- /dev/null +++ b/test/extension/io/.gitignore @@ -0,0 +1 @@ +/output/ diff --git a/io/test/CMakeLists.txt b/test/extension/io/CMakeLists.txt similarity index 97% rename from io/test/CMakeLists.txt rename to test/extension/io/CMakeLists.txt index 18703c57dd..ac3e9d7197 100644 --- a/io/test/CMakeLists.txt +++ b/test/extension/io/CMakeLists.txt @@ -6,7 +6,7 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # -message(STATUS "Boost.GIL: Configuring IO extension tests") +message(STATUS "Boost.GIL: Configuring tests in test/extension/io") set(_formats bmp diff --git a/io/test/Jamfile b/test/extension/io/Jamfile similarity index 98% rename from io/test/Jamfile rename to test/extension/io/Jamfile index 99a71298c7..1ff4218980 100644 --- a/io/test/Jamfile +++ b/test/extension/io/Jamfile @@ -8,7 +8,6 @@ # (See accompanying file LICENSE_1_0.txt or # copy at http://www.boost.org/LICENSE_1_0.txt) -import testing ; import ac ; using libjpeg : : : : true ; # work around bug on master @@ -20,13 +19,14 @@ lib raw : : raw ; project : requirements - $(BOOST_ROOT) /boost/test//boost_unit_test_framework /boost/system//boost_system /boost/filesystem//boost_filesystem shared:BOOST_TEST_DYN_LINK=1 ; +alias headers : [ generate_self_contained_headers extension/io ] ; + alias simple : [ run all_formats_test.cpp : # args diff --git a/io/test/all_formats_test.cpp b/test/extension/io/all_formats_test.cpp similarity index 100% rename from io/test/all_formats_test.cpp rename to test/extension/io/all_formats_test.cpp diff --git a/io/test/bmp_old_test.cpp b/test/extension/io/bmp_old_test.cpp similarity index 100% rename from io/test/bmp_old_test.cpp rename to test/extension/io/bmp_old_test.cpp diff --git a/io/test/bmp_read_test.cpp b/test/extension/io/bmp_read_test.cpp similarity index 100% rename from io/test/bmp_read_test.cpp rename to test/extension/io/bmp_read_test.cpp diff --git a/io/test/bmp_test.cpp b/test/extension/io/bmp_test.cpp similarity index 100% rename from io/test/bmp_test.cpp rename to test/extension/io/bmp_test.cpp diff --git a/io/test/bmp_write_test.cpp b/test/extension/io/bmp_write_test.cpp similarity index 100% rename from io/test/bmp_write_test.cpp rename to test/extension/io/bmp_write_test.cpp diff --git a/io/test/cmp_view.hpp b/test/extension/io/cmp_view.hpp similarity index 100% rename from io/test/cmp_view.hpp rename to test/extension/io/cmp_view.hpp diff --git a/io/test/color_space_write_test.hpp b/test/extension/io/color_space_write_test.hpp similarity index 100% rename from io/test/color_space_write_test.hpp rename to test/extension/io/color_space_write_test.hpp diff --git a/io/test/fabscript b/test/extension/io/fabscript similarity index 100% rename from io/test/fabscript rename to test/extension/io/fabscript diff --git a/io/test_images/bmp/readme.txt b/test/extension/io/images/bmp/readme.txt similarity index 100% rename from io/test_images/bmp/readme.txt rename to test/extension/io/images/bmp/readme.txt diff --git a/io/test_images/bmp/test.bmp b/test/extension/io/images/bmp/test.bmp similarity index 100% rename from io/test_images/bmp/test.bmp rename to test/extension/io/images/bmp/test.bmp diff --git a/io/test_images/jpg/EddDawson/36dpi.jpg b/test/extension/io/images/jpg/EddDawson/36dpi.jpg similarity index 100% rename from io/test_images/jpg/EddDawson/36dpi.jpg rename to test/extension/io/images/jpg/EddDawson/36dpi.jpg diff --git a/io/test_images/jpg/test.jpg b/test/extension/io/images/jpg/test.jpg similarity index 100% rename from io/test_images/jpg/test.jpg rename to test/extension/io/images/jpg/test.jpg diff --git a/io/test_images/png/EddDawson/36dpi.png b/test/extension/io/images/png/EddDawson/36dpi.png similarity index 100% rename from io/test_images/png/EddDawson/36dpi.png rename to test/extension/io/images/png/EddDawson/36dpi.png diff --git a/io/test_images/png/PngSuite/readme.txt b/test/extension/io/images/png/PngSuite/readme.txt similarity index 100% rename from io/test_images/png/PngSuite/readme.txt rename to test/extension/io/images/png/PngSuite/readme.txt diff --git a/io/test_images/png/grayalpha-with-tRNS-chunk.png b/test/extension/io/images/png/grayalpha-with-tRNS-chunk.png similarity index 100% rename from io/test_images/png/grayalpha-with-tRNS-chunk.png rename to test/extension/io/images/png/grayalpha-with-tRNS-chunk.png diff --git a/io/test_images/png/test.png b/test/extension/io/images/png/test.png similarity index 100% rename from io/test_images/png/test.png rename to test/extension/io/images/png/test.png diff --git a/io/test_images/pnm/p1.pnm b/test/extension/io/images/pnm/p1.pnm similarity index 100% rename from io/test_images/pnm/p1.pnm rename to test/extension/io/images/pnm/p1.pnm diff --git a/io/test_images/pnm/p2.pnm b/test/extension/io/images/pnm/p2.pnm similarity index 100% rename from io/test_images/pnm/p2.pnm rename to test/extension/io/images/pnm/p2.pnm diff --git a/io/test_images/pnm/p3.pnm b/test/extension/io/images/pnm/p3.pnm similarity index 100% rename from io/test_images/pnm/p3.pnm rename to test/extension/io/images/pnm/p3.pnm diff --git a/io/test_images/pnm/p4.pnm b/test/extension/io/images/pnm/p4.pnm similarity index 100% rename from io/test_images/pnm/p4.pnm rename to test/extension/io/images/pnm/p4.pnm diff --git a/io/test_images/pnm/p5.pnm b/test/extension/io/images/pnm/p5.pnm similarity index 100% rename from io/test_images/pnm/p5.pnm rename to test/extension/io/images/pnm/p5.pnm diff --git a/io/test_images/pnm/p6.pnm b/test/extension/io/images/pnm/p6.pnm similarity index 100% rename from io/test_images/pnm/p6.pnm rename to test/extension/io/images/pnm/p6.pnm diff --git a/io/test_images/pnm/readme.txt b/test/extension/io/images/pnm/readme.txt similarity index 100% rename from io/test_images/pnm/readme.txt rename to test/extension/io/images/pnm/readme.txt diff --git a/io/test_images/pnm/rgb.pnm b/test/extension/io/images/pnm/rgb.pnm similarity index 100% rename from io/test_images/pnm/rgb.pnm rename to test/extension/io/images/pnm/rgb.pnm diff --git a/io/test_images/raw/RAW_CANON_D30_SRGB.CRW b/test/extension/io/images/raw/RAW_CANON_D30_SRGB.CRW similarity index 100% rename from io/test_images/raw/RAW_CANON_D30_SRGB.CRW rename to test/extension/io/images/raw/RAW_CANON_D30_SRGB.CRW diff --git a/io/test_images/raw/readme.txt b/test/extension/io/images/raw/readme.txt similarity index 100% rename from io/test_images/raw/readme.txt rename to test/extension/io/images/raw/readme.txt diff --git a/io/test_images/readme.md b/test/extension/io/images/readme.md similarity index 100% rename from io/test_images/readme.md rename to test/extension/io/images/readme.md diff --git a/io/test_images/targa/24BPP_compressed.tga b/test/extension/io/images/targa/24BPP_compressed.tga similarity index 100% rename from io/test_images/targa/24BPP_compressed.tga rename to test/extension/io/images/targa/24BPP_compressed.tga diff --git a/io/test_images/targa/24BPP_compressed_ul_origin.tga b/test/extension/io/images/targa/24BPP_compressed_ul_origin.tga similarity index 100% rename from io/test_images/targa/24BPP_compressed_ul_origin.tga rename to test/extension/io/images/targa/24BPP_compressed_ul_origin.tga diff --git a/io/test_images/targa/24BPP_uncompressed.tga b/test/extension/io/images/targa/24BPP_uncompressed.tga similarity index 100% rename from io/test_images/targa/24BPP_uncompressed.tga rename to test/extension/io/images/targa/24BPP_uncompressed.tga diff --git a/io/test_images/targa/24BPP_uncompressed_ul_origin.tga b/test/extension/io/images/targa/24BPP_uncompressed_ul_origin.tga similarity index 100% rename from io/test_images/targa/24BPP_uncompressed_ul_origin.tga rename to test/extension/io/images/targa/24BPP_uncompressed_ul_origin.tga diff --git a/io/test_images/targa/32BPP_compressed.tga b/test/extension/io/images/targa/32BPP_compressed.tga similarity index 100% rename from io/test_images/targa/32BPP_compressed.tga rename to test/extension/io/images/targa/32BPP_compressed.tga diff --git a/io/test_images/targa/32BPP_compressed_ul_origin.tga b/test/extension/io/images/targa/32BPP_compressed_ul_origin.tga similarity index 100% rename from io/test_images/targa/32BPP_compressed_ul_origin.tga rename to test/extension/io/images/targa/32BPP_compressed_ul_origin.tga diff --git a/io/test_images/targa/32BPP_uncompressed.tga b/test/extension/io/images/targa/32BPP_uncompressed.tga similarity index 100% rename from io/test_images/targa/32BPP_uncompressed.tga rename to test/extension/io/images/targa/32BPP_uncompressed.tga diff --git a/io/test_images/targa/32BPP_uncompressed_ul_origin.tga b/test/extension/io/images/targa/32BPP_uncompressed_ul_origin.tga similarity index 100% rename from io/test_images/targa/32BPP_uncompressed_ul_origin.tga rename to test/extension/io/images/targa/32BPP_uncompressed_ul_origin.tga diff --git a/io/test_images/targa/fileformat_info/readme.txt b/test/extension/io/images/targa/fileformat_info/readme.txt similarity index 100% rename from io/test_images/targa/fileformat_info/readme.txt rename to test/extension/io/images/targa/fileformat_info/readme.txt diff --git a/io/test_images/tiff/graphicmagick/readme.txt b/test/extension/io/images/tiff/graphicmagick/readme.txt similarity index 100% rename from io/test_images/tiff/graphicmagick/readme.txt rename to test/extension/io/images/tiff/graphicmagick/readme.txt diff --git a/io/test_images/tiff/libtiffpic/readme.txt b/test/extension/io/images/tiff/libtiffpic/readme.txt similarity index 100% rename from io/test_images/tiff/libtiffpic/readme.txt rename to test/extension/io/images/tiff/libtiffpic/readme.txt diff --git a/io/test_images/tiff/test.tif b/test/extension/io/images/tiff/test.tif similarity index 100% rename from io/test_images/tiff/test.tif rename to test/extension/io/images/tiff/test.tif diff --git a/io/test/jpeg_old_test.cpp b/test/extension/io/jpeg_old_test.cpp similarity index 100% rename from io/test/jpeg_old_test.cpp rename to test/extension/io/jpeg_old_test.cpp diff --git a/io/test/jpeg_read_test.cpp b/test/extension/io/jpeg_read_test.cpp similarity index 100% rename from io/test/jpeg_read_test.cpp rename to test/extension/io/jpeg_read_test.cpp diff --git a/io/test/jpeg_test.cpp b/test/extension/io/jpeg_test.cpp similarity index 100% rename from io/test/jpeg_test.cpp rename to test/extension/io/jpeg_test.cpp diff --git a/io/test/jpeg_write_test.cpp b/test/extension/io/jpeg_write_test.cpp similarity index 100% rename from io/test/jpeg_write_test.cpp rename to test/extension/io/jpeg_write_test.cpp diff --git a/io/test/make.cpp b/test/extension/io/make.cpp similarity index 100% rename from io/test/make.cpp rename to test/extension/io/make.cpp diff --git a/io/test/mandel_view.hpp b/test/extension/io/mandel_view.hpp similarity index 100% rename from io/test/mandel_view.hpp rename to test/extension/io/mandel_view.hpp diff --git a/io/test/paths.hpp b/test/extension/io/paths.hpp similarity index 79% rename from io/test/paths.hpp rename to test/extension/io/paths.hpp index 8e93f9540e..31b9bea060 100644 --- a/io/test/paths.hpp +++ b/test/extension/io/paths.hpp @@ -30,28 +30,28 @@ #pragma GCC diagnostic pop #endif -// `base` holds the path to ../.., i.e. the directory containing `test_images` -static const std::string base = (boost::filesystem::absolute(boost::filesystem::path(__FILE__)).parent_path().parent_path().string()) + "/"; +// `base` holds the path to ../.., i.e. the directory containing `images` +static const std::string base = (boost::filesystem::absolute(boost::filesystem::path(__FILE__)).parent_path().string()) + "/"; -static const std::string bmp_in = base + "test_images/bmp/"; +static const std::string bmp_in = base + "images/bmp/"; static const std::string bmp_out = base + "output/bmp/"; -static const std::string jpeg_in = base + "test_images/jpg/"; +static const std::string jpeg_in = base + "images/jpg/"; static const std::string jpeg_out = base + "output/jpeg/"; -static const std::string png_base_in = base + "test_images/png/"; +static const std::string png_base_in = base + "images/png/"; static const std::string png_in = png_base_in + "PngSuite/"; static const std::string png_out = base + "output/png/"; -static const std::string pnm_in = base + "test_images/pnm/"; +static const std::string pnm_in = base + "images/pnm/"; static const std::string pnm_out = base + "output/pnm/"; -static const std::string raw_in = base + "test_images/raw/"; +static const std::string raw_in = base + "images/raw/"; -static const std::string targa_in = base + "test_images/targa/"; +static const std::string targa_in = base + "images/targa/"; static const std::string targa_out = base + "output/targa/"; -static const std::string tiff_in = base + "test_images/tiff/"; +static const std::string tiff_in = base + "images/tiff/"; static const std::string tiff_out = base + "output/tiff/"; static const std::string tiff_in_GM = tiff_in + "graphicmagick/"; diff --git a/io/test/png_file_format_test.cpp b/test/extension/io/png_file_format_test.cpp similarity index 100% rename from io/test/png_file_format_test.cpp rename to test/extension/io/png_file_format_test.cpp diff --git a/io/test/png_old_test.cpp b/test/extension/io/png_old_test.cpp similarity index 100% rename from io/test/png_old_test.cpp rename to test/extension/io/png_old_test.cpp diff --git a/io/test/png_read_test.cpp b/test/extension/io/png_read_test.cpp similarity index 100% rename from io/test/png_read_test.cpp rename to test/extension/io/png_read_test.cpp diff --git a/io/test/png_test.cpp b/test/extension/io/png_test.cpp similarity index 100% rename from io/test/png_test.cpp rename to test/extension/io/png_test.cpp diff --git a/io/test/png_write_test.cpp b/test/extension/io/png_write_test.cpp similarity index 100% rename from io/test/png_write_test.cpp rename to test/extension/io/png_write_test.cpp diff --git a/io/test/pnm_old_test.cpp b/test/extension/io/pnm_old_test.cpp similarity index 100% rename from io/test/pnm_old_test.cpp rename to test/extension/io/pnm_old_test.cpp diff --git a/io/test/pnm_read_test.cpp b/test/extension/io/pnm_read_test.cpp similarity index 100% rename from io/test/pnm_read_test.cpp rename to test/extension/io/pnm_read_test.cpp diff --git a/io/test/pnm_test.cpp b/test/extension/io/pnm_test.cpp similarity index 100% rename from io/test/pnm_test.cpp rename to test/extension/io/pnm_test.cpp diff --git a/io/test/pnm_write_test.cpp b/test/extension/io/pnm_write_test.cpp similarity index 100% rename from io/test/pnm_write_test.cpp rename to test/extension/io/pnm_write_test.cpp diff --git a/io/test/raw_test.cpp b/test/extension/io/raw_test.cpp similarity index 100% rename from io/test/raw_test.cpp rename to test/extension/io/raw_test.cpp diff --git a/io/test/scanline_read_test.hpp b/test/extension/io/scanline_read_test.hpp similarity index 100% rename from io/test/scanline_read_test.hpp rename to test/extension/io/scanline_read_test.hpp diff --git a/io/test/subimage_test.hpp b/test/extension/io/subimage_test.hpp similarity index 100% rename from io/test/subimage_test.hpp rename to test/extension/io/subimage_test.hpp diff --git a/io/test/targa_old_test.cpp b/test/extension/io/targa_old_test.cpp similarity index 100% rename from io/test/targa_old_test.cpp rename to test/extension/io/targa_old_test.cpp diff --git a/io/test/targa_read_test.cpp b/test/extension/io/targa_read_test.cpp similarity index 100% rename from io/test/targa_read_test.cpp rename to test/extension/io/targa_read_test.cpp diff --git a/io/test/targa_test.cpp b/test/extension/io/targa_test.cpp similarity index 100% rename from io/test/targa_test.cpp rename to test/extension/io/targa_test.cpp diff --git a/io/test/targa_write_test.cpp b/test/extension/io/targa_write_test.cpp similarity index 100% rename from io/test/targa_write_test.cpp rename to test/extension/io/targa_write_test.cpp diff --git a/io/test/test.cpp b/test/extension/io/test.cpp similarity index 100% rename from io/test/test.cpp rename to test/extension/io/test.cpp diff --git a/io/test/tiff_file_format_test.cpp b/test/extension/io/tiff_file_format_test.cpp similarity index 100% rename from io/test/tiff_file_format_test.cpp rename to test/extension/io/tiff_file_format_test.cpp diff --git a/io/test/tiff_old_test.cpp b/test/extension/io/tiff_old_test.cpp similarity index 100% rename from io/test/tiff_old_test.cpp rename to test/extension/io/tiff_old_test.cpp diff --git a/io/test/tiff_subimage_test.cpp b/test/extension/io/tiff_subimage_test.cpp similarity index 100% rename from io/test/tiff_subimage_test.cpp rename to test/extension/io/tiff_subimage_test.cpp diff --git a/io/test/tiff_test.cpp b/test/extension/io/tiff_test.cpp similarity index 100% rename from io/test/tiff_test.cpp rename to test/extension/io/tiff_test.cpp diff --git a/io/test/tiff_tiled_float_test.cpp b/test/extension/io/tiff_tiled_float_test.cpp similarity index 100% rename from io/test/tiff_tiled_float_test.cpp rename to test/extension/io/tiff_tiled_float_test.cpp diff --git a/io/test/tiff_tiled_minisblack_test_1-10.cpp b/test/extension/io/tiff_tiled_minisblack_test_1-10.cpp similarity index 100% rename from io/test/tiff_tiled_minisblack_test_1-10.cpp rename to test/extension/io/tiff_tiled_minisblack_test_1-10.cpp diff --git a/io/test/tiff_tiled_minisblack_test_11-20.cpp b/test/extension/io/tiff_tiled_minisblack_test_11-20.cpp similarity index 100% rename from io/test/tiff_tiled_minisblack_test_11-20.cpp rename to test/extension/io/tiff_tiled_minisblack_test_11-20.cpp diff --git a/io/test/tiff_tiled_minisblack_test_21-31_32-64.cpp b/test/extension/io/tiff_tiled_minisblack_test_21-31_32-64.cpp similarity index 100% rename from io/test/tiff_tiled_minisblack_test_21-31_32-64.cpp rename to test/extension/io/tiff_tiled_minisblack_test_21-31_32-64.cpp diff --git a/io/test/tiff_tiled_minisblack_write_test_1-10.cpp b/test/extension/io/tiff_tiled_minisblack_write_test_1-10.cpp similarity index 100% rename from io/test/tiff_tiled_minisblack_write_test_1-10.cpp rename to test/extension/io/tiff_tiled_minisblack_write_test_1-10.cpp diff --git a/io/test/tiff_tiled_minisblack_write_test_11-20.cpp b/test/extension/io/tiff_tiled_minisblack_write_test_11-20.cpp similarity index 100% rename from io/test/tiff_tiled_minisblack_write_test_11-20.cpp rename to test/extension/io/tiff_tiled_minisblack_write_test_11-20.cpp diff --git a/io/test/tiff_tiled_minisblack_write_test_21-31_32-64.cpp b/test/extension/io/tiff_tiled_minisblack_write_test_21-31_32-64.cpp similarity index 100% rename from io/test/tiff_tiled_minisblack_write_test_21-31_32-64.cpp rename to test/extension/io/tiff_tiled_minisblack_write_test_21-31_32-64.cpp diff --git a/io/test/tiff_tiled_palette_test_1-8.cpp b/test/extension/io/tiff_tiled_palette_test_1-8.cpp similarity index 100% rename from io/test/tiff_tiled_palette_test_1-8.cpp rename to test/extension/io/tiff_tiled_palette_test_1-8.cpp diff --git a/io/test/tiff_tiled_palette_test_8-16.cpp b/test/extension/io/tiff_tiled_palette_test_8-16.cpp similarity index 100% rename from io/test/tiff_tiled_palette_test_8-16.cpp rename to test/extension/io/tiff_tiled_palette_test_8-16.cpp diff --git a/io/test/tiff_tiled_palette_write_test_1-8.cpp b/test/extension/io/tiff_tiled_palette_write_test_1-8.cpp similarity index 100% rename from io/test/tiff_tiled_palette_write_test_1-8.cpp rename to test/extension/io/tiff_tiled_palette_write_test_1-8.cpp diff --git a/io/test/tiff_tiled_palette_write_test_8-16.cpp b/test/extension/io/tiff_tiled_palette_write_test_8-16.cpp similarity index 100% rename from io/test/tiff_tiled_palette_write_test_8-16.cpp rename to test/extension/io/tiff_tiled_palette_write_test_8-16.cpp diff --git a/io/test/tiff_tiled_read_macros.hpp b/test/extension/io/tiff_tiled_read_macros.hpp similarity index 100% rename from io/test/tiff_tiled_read_macros.hpp rename to test/extension/io/tiff_tiled_read_macros.hpp diff --git a/io/test/tiff_tiled_rgb_contig_test_1-10.cpp b/test/extension/io/tiff_tiled_rgb_contig_test_1-10.cpp similarity index 100% rename from io/test/tiff_tiled_rgb_contig_test_1-10.cpp rename to test/extension/io/tiff_tiled_rgb_contig_test_1-10.cpp diff --git a/io/test/tiff_tiled_rgb_contig_test_11-20.cpp b/test/extension/io/tiff_tiled_rgb_contig_test_11-20.cpp similarity index 100% rename from io/test/tiff_tiled_rgb_contig_test_11-20.cpp rename to test/extension/io/tiff_tiled_rgb_contig_test_11-20.cpp diff --git a/io/test/tiff_tiled_rgb_contig_test_21-31_32_64.cpp b/test/extension/io/tiff_tiled_rgb_contig_test_21-31_32_64.cpp similarity index 100% rename from io/test/tiff_tiled_rgb_contig_test_21-31_32_64.cpp rename to test/extension/io/tiff_tiled_rgb_contig_test_21-31_32_64.cpp diff --git a/io/test/tiff_tiled_rgb_contig_write_test_1-10.cpp b/test/extension/io/tiff_tiled_rgb_contig_write_test_1-10.cpp similarity index 100% rename from io/test/tiff_tiled_rgb_contig_write_test_1-10.cpp rename to test/extension/io/tiff_tiled_rgb_contig_write_test_1-10.cpp diff --git a/io/test/tiff_tiled_rgb_contig_write_test_11-20.cpp b/test/extension/io/tiff_tiled_rgb_contig_write_test_11-20.cpp similarity index 100% rename from io/test/tiff_tiled_rgb_contig_write_test_11-20.cpp rename to test/extension/io/tiff_tiled_rgb_contig_write_test_11-20.cpp diff --git a/io/test/tiff_tiled_rgb_contig_write_test_21-31_32_64.cpp b/test/extension/io/tiff_tiled_rgb_contig_write_test_21-31_32_64.cpp similarity index 100% rename from io/test/tiff_tiled_rgb_contig_write_test_21-31_32_64.cpp rename to test/extension/io/tiff_tiled_rgb_contig_write_test_21-31_32_64.cpp diff --git a/io/test/tiff_tiled_rgb_planar_test_1-10.cpp b/test/extension/io/tiff_tiled_rgb_planar_test_1-10.cpp similarity index 100% rename from io/test/tiff_tiled_rgb_planar_test_1-10.cpp rename to test/extension/io/tiff_tiled_rgb_planar_test_1-10.cpp diff --git a/io/test/tiff_tiled_rgb_planar_test_11-20.cpp b/test/extension/io/tiff_tiled_rgb_planar_test_11-20.cpp similarity index 100% rename from io/test/tiff_tiled_rgb_planar_test_11-20.cpp rename to test/extension/io/tiff_tiled_rgb_planar_test_11-20.cpp diff --git a/io/test/tiff_tiled_rgb_planar_test_21-31_32_64.cpp b/test/extension/io/tiff_tiled_rgb_planar_test_21-31_32_64.cpp similarity index 100% rename from io/test/tiff_tiled_rgb_planar_test_21-31_32_64.cpp rename to test/extension/io/tiff_tiled_rgb_planar_test_21-31_32_64.cpp diff --git a/io/test/tiff_tiled_test.cpp b/test/extension/io/tiff_tiled_test.cpp similarity index 100% rename from io/test/tiff_tiled_test.cpp rename to test/extension/io/tiff_tiled_test.cpp diff --git a/io/test/tiff_tiled_write_macros.hpp b/test/extension/io/tiff_tiled_write_macros.hpp similarity index 100% rename from io/test/tiff_tiled_write_macros.hpp rename to test/extension/io/tiff_tiled_write_macros.hpp diff --git a/io/test/tiff_write_test.cpp b/test/extension/io/tiff_write_test.cpp similarity index 100% rename from io/test/tiff_write_test.cpp rename to test/extension/io/tiff_write_test.cpp diff --git a/numeric/test/CMakeLists.txt b/test/extension/numeric/CMakeLists.txt similarity index 88% rename from numeric/test/CMakeLists.txt rename to test/extension/numeric/CMakeLists.txt index ff8cde41ca..23de5c8617 100644 --- a/numeric/test/CMakeLists.txt +++ b/test/extension/numeric/CMakeLists.txt @@ -6,7 +6,7 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # -message(STATUS "Boost.GIL: Configuring Numeric extension tests") +message(STATUS "Boost.GIL: Configuring tests in test/extension/numeric") foreach(_name numeric) diff --git a/numeric/test/Jamfile b/test/extension/numeric/Jamfile similarity index 81% rename from numeric/test/Jamfile rename to test/extension/numeric/Jamfile index 9e4de7998b..16ef3621f5 100644 --- a/numeric/test/Jamfile +++ b/test/extension/numeric/Jamfile @@ -10,9 +10,11 @@ import testing ; project : requirements - $(BOOST_ROOT) /boost/test//boost_unit_test_framework shared:BOOST_TEST_DYN_LINK=1 ; +alias headers : [ generate_self_contained_headers extension/numeric ] ; + +run matrix3x2.cpp ; run numeric.cpp ; diff --git a/test/extension/numeric/matrix3x2.cpp b/test/extension/numeric/matrix3x2.cpp new file mode 100644 index 0000000000..452db415ff --- /dev/null +++ b/test/extension/numeric/matrix3x2.cpp @@ -0,0 +1,170 @@ +// +// Copyright 2019 Mateusz Loskot +// +// Distributed under the Boost Software License, Version 1.0 +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +// +#include +#include +#include +#include + +#define BOOST_TEST_MODULE test_ext_numeric_matrix3x2 +#include "unit_test.hpp" + +namespace gil = boost::gil; + +namespace { +constexpr double HALF_PI = 1.57079632679489661923; +} + +BOOST_AUTO_TEST_CASE(matrix3x2_default_constructor) +{ + gil::matrix3x2 m1; + BOOST_TEST(m1.a == 1); + BOOST_TEST(m1.b == 0); + BOOST_TEST(m1.c == 0); + BOOST_TEST(m1.d == 1); + BOOST_TEST(m1.e == 0); + BOOST_TEST(m1.f == 0); +} + +BOOST_AUTO_TEST_CASE(matrix3x2_parameterized_constructor) +{ + gil::matrix3x2 m1(1, 2, 3, 4, 5, 6); + BOOST_TEST(m1.a == 1); + BOOST_TEST(m1.b == 2); + BOOST_TEST(m1.c == 3); + BOOST_TEST(m1.d == 4); + BOOST_TEST(m1.e == 5); + BOOST_TEST(m1.f == 6); +} + +BOOST_AUTO_TEST_CASE(matrix3x2_copy_constructor) +{ + gil::matrix3x2 m1(1, 2, 3, 4, 5, 6); + gil::matrix3x2 m2(m1); + BOOST_TEST(m2.a == 1); + BOOST_TEST(m2.b == 2); + BOOST_TEST(m2.c == 3); + BOOST_TEST(m2.d == 4); + BOOST_TEST(m2.e == 5); + BOOST_TEST(m2.f == 6); +} + +BOOST_AUTO_TEST_CASE(matrix3x2_assignment_operator) +{ + gil::matrix3x2 m1(1, 2, 3, 4, 5, 6); + gil::matrix3x2 m2; + m2 = m1; + BOOST_TEST(m2.a == 1); + BOOST_TEST(m2.b == 2); + BOOST_TEST(m2.c == 3); + BOOST_TEST(m2.d == 4); + BOOST_TEST(m2.e == 5); + BOOST_TEST(m2.f == 6); +} + +BOOST_AUTO_TEST_CASE(matrix3x2_multiplication_assignment) +{ + gil::matrix3x2 m1; + gil::matrix3x2 m2; + m2 *= m1; + BOOST_TEST(m2.a == 1); + BOOST_TEST(m2.b == 0); + BOOST_TEST(m2.c == 0); + BOOST_TEST(m2.d == 1); + BOOST_TEST(m2.e == 0); + BOOST_TEST(m2.f == 0); + + gil::matrix3x2 m3(0, 0, 0, 0, 0, 0); + m2 *= m3; + BOOST_TEST(m2.a == 0); + BOOST_TEST(m2.b == 0); + BOOST_TEST(m2.c == 0); + BOOST_TEST(m2.d == 0); + BOOST_TEST(m2.e == 0); + BOOST_TEST(m2.f == 0); +} + +BOOST_AUTO_TEST_CASE(matrix3x2_matrix3x2_multiplication) +{ + gil::matrix3x2 m1; + gil::matrix3x2 m2(0, 0, 0, 0, 0, 0); + gil::matrix3x2 m3; + m3 = m1 * m2; + BOOST_TEST(m3.a == 0); + BOOST_TEST(m3.b == 0); + BOOST_TEST(m3.c == 0); + BOOST_TEST(m3.d == 0); + BOOST_TEST(m3.e == 0); + BOOST_TEST(m3.f == 0); +} + +BOOST_AUTO_TEST_CASE(matrix3x2_vector_multiplication) +{ + gil::matrix3x2 m1; + gil::point v1{2, 4}; + + gil::point v2 = v1 * m1; + BOOST_TEST(v2.x == 2); + BOOST_TEST(v2.y == 4); + + gil::point v3 = gil::transform(m1, v1); + BOOST_TEST(v3.x == 2); + BOOST_TEST(v3.y == 4); +} + +BOOST_AUTO_TEST_CASE(matrix3x2_get_rotate) +{ + auto m1 = gil::matrix3x2::get_rotate(HALF_PI); + BOOST_TEST(m1.a == std::cos(HALF_PI), btt::tolerance(0.03)); + BOOST_TEST(m1.b == 1); + BOOST_TEST(m1.c == -1); + BOOST_TEST(m1.d == std::cos(HALF_PI), btt::tolerance(0.03)); + BOOST_TEST(m1.e == 0); + BOOST_TEST(m1.f == 0); +} + +BOOST_AUTO_TEST_CASE(matrix3x2_get_scale) +{ + gil::matrix3x2 m1; + m1 = gil::matrix3x2::get_scale(2); + BOOST_TEST(m1.a == 2); + BOOST_TEST(m1.b == 0); + BOOST_TEST(m1.c == 0); + BOOST_TEST(m1.d == 2); + BOOST_TEST(m1.e == 0); + BOOST_TEST(m1.f == 0); + m1 = gil::matrix3x2::get_scale(2, 4); + BOOST_TEST(m1.a == 2); + BOOST_TEST(m1.d == 4); + m1 = gil::matrix3x2::get_scale(gil::point{4, 8}); + BOOST_TEST(m1.a == 4); + BOOST_TEST(m1.d == 8); +} + +BOOST_AUTO_TEST_CASE(matrix3x2_get_translate) +{ + gil::matrix3x2 m1; + m1 = gil::matrix3x2::get_translate(2, 4); + BOOST_TEST(m1.a == 1); + BOOST_TEST(m1.b == 0); + BOOST_TEST(m1.c == 0); + BOOST_TEST(m1.d == 1); + BOOST_TEST(m1.e == 2); + BOOST_TEST(m1.f == 4); + m1 = gil::matrix3x2::get_translate(gil::point{4, 8}); + BOOST_TEST(m1.e == 4); + BOOST_TEST(m1.f == 8); +} + +BOOST_AUTO_TEST_CASE(matrix3x2_transform) +{ + gil::matrix3x2 m1; + gil::point v1{2, 4}; + gil::point v2 = gil::transform(m1, v1); + BOOST_TEST(v2.x == 2); + BOOST_TEST(v2.y == 4); +} diff --git a/numeric/test/numeric.cpp b/test/extension/numeric/numeric.cpp similarity index 100% rename from numeric/test/numeric.cpp rename to test/extension/numeric/numeric.cpp diff --git a/toolbox/test/CMakeLists.txt b/test/extension/toolbox/CMakeLists.txt similarity index 93% rename from toolbox/test/CMakeLists.txt rename to test/extension/toolbox/CMakeLists.txt index af28984874..f877f3f82c 100644 --- a/toolbox/test/CMakeLists.txt +++ b/test/extension/toolbox/CMakeLists.txt @@ -6,7 +6,7 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # -message(STATUS "Boost.GIL: Configuring Toolbox extension tests") +message(STATUS "Boost.GIL: Configuring tests in test/extension/toolbox") add_executable(test_ext_toolbox "") target_sources(test_ext_toolbox diff --git a/toolbox/test/Jamfile b/test/extension/toolbox/Jamfile similarity index 93% rename from toolbox/test/Jamfile rename to test/extension/toolbox/Jamfile index f71d999ef1..3f6c3fc2c8 100644 --- a/toolbox/test/Jamfile +++ b/test/extension/toolbox/Jamfile @@ -10,11 +10,12 @@ import testing ; project : requirements - $(BOOST_ROOT) /boost/test//boost_unit_test_framework shared:BOOST_TEST_DYN_LINK=1 ; +alias headers : [ generate_self_contained_headers extension/toolbox ] ; + run test.cpp channel_type.cpp diff --git a/toolbox/test/channel_type.cpp b/test/extension/toolbox/channel_type.cpp similarity index 100% rename from toolbox/test/channel_type.cpp rename to test/extension/toolbox/channel_type.cpp diff --git a/toolbox/test/channel_view.cpp b/test/extension/toolbox/channel_view.cpp similarity index 100% rename from toolbox/test/channel_view.cpp rename to test/extension/toolbox/channel_view.cpp diff --git a/toolbox/test/cmyka.cpp b/test/extension/toolbox/cmyka.cpp similarity index 100% rename from toolbox/test/cmyka.cpp rename to test/extension/toolbox/cmyka.cpp diff --git a/toolbox/test/fabscript b/test/extension/toolbox/fabscript similarity index 100% rename from toolbox/test/fabscript rename to test/extension/toolbox/fabscript diff --git a/toolbox/test/get_num_bits.cpp b/test/extension/toolbox/get_num_bits.cpp similarity index 100% rename from toolbox/test/get_num_bits.cpp rename to test/extension/toolbox/get_num_bits.cpp diff --git a/toolbox/test/get_pixel_type.cpp b/test/extension/toolbox/get_pixel_type.cpp similarity index 100% rename from toolbox/test/get_pixel_type.cpp rename to test/extension/toolbox/get_pixel_type.cpp diff --git a/toolbox/test/gray_alpha.cpp b/test/extension/toolbox/gray_alpha.cpp similarity index 100% rename from toolbox/test/gray_alpha.cpp rename to test/extension/toolbox/gray_alpha.cpp diff --git a/toolbox/test/gray_to_rgba.cpp b/test/extension/toolbox/gray_to_rgba.cpp similarity index 100% rename from toolbox/test/gray_to_rgba.cpp rename to test/extension/toolbox/gray_to_rgba.cpp diff --git a/toolbox/test/hsl_hsv_test.cpp b/test/extension/toolbox/hsl_hsv_test.cpp similarity index 100% rename from toolbox/test/hsl_hsv_test.cpp rename to test/extension/toolbox/hsl_hsv_test.cpp diff --git a/toolbox/test/indexed_image_test.cpp b/test/extension/toolbox/indexed_image_test.cpp similarity index 100% rename from toolbox/test/indexed_image_test.cpp rename to test/extension/toolbox/indexed_image_test.cpp diff --git a/toolbox/test/is_bit_aligned.cpp b/test/extension/toolbox/is_bit_aligned.cpp similarity index 100% rename from toolbox/test/is_bit_aligned.cpp rename to test/extension/toolbox/is_bit_aligned.cpp diff --git a/toolbox/test/is_homogeneous.cpp b/test/extension/toolbox/is_homogeneous.cpp similarity index 100% rename from toolbox/test/is_homogeneous.cpp rename to test/extension/toolbox/is_homogeneous.cpp diff --git a/toolbox/test/is_similar.cpp b/test/extension/toolbox/is_similar.cpp similarity index 100% rename from toolbox/test/is_similar.cpp rename to test/extension/toolbox/is_similar.cpp diff --git a/toolbox/test/lab_test.cpp b/test/extension/toolbox/lab_test.cpp similarity index 100% rename from toolbox/test/lab_test.cpp rename to test/extension/toolbox/lab_test.cpp diff --git a/toolbox/test/pixel_bit_size.cpp b/test/extension/toolbox/pixel_bit_size.cpp similarity index 100% rename from toolbox/test/pixel_bit_size.cpp rename to test/extension/toolbox/pixel_bit_size.cpp diff --git a/toolbox/test/rgb_to_luminance.cpp b/test/extension/toolbox/rgb_to_luminance.cpp similarity index 100% rename from toolbox/test/rgb_to_luminance.cpp rename to test/extension/toolbox/rgb_to_luminance.cpp diff --git a/toolbox/test/subchroma_image.cpp b/test/extension/toolbox/subchroma_image.cpp similarity index 100% rename from toolbox/test/subchroma_image.cpp rename to test/extension/toolbox/subchroma_image.cpp diff --git a/toolbox/test/test.cpp b/test/extension/toolbox/test.cpp similarity index 100% rename from toolbox/test/test.cpp rename to test/extension/toolbox/test.cpp diff --git a/toolbox/test/xyz_test.cpp b/test/extension/toolbox/xyz_test.cpp similarity index 100% rename from toolbox/test/xyz_test.cpp rename to test/extension/toolbox/xyz_test.cpp diff --git a/test/headers/CMakeLists.txt b/test/header/CMakeLists.txt similarity index 100% rename from test/headers/CMakeLists.txt rename to test/header/CMakeLists.txt diff --git a/test/headers/main.cpp b/test/header/main.cpp similarity index 100% rename from test/headers/main.cpp rename to test/header/main.cpp diff --git a/test/headers/Jamfile b/test/headers/Jamfile deleted file mode 100644 index 8125296b4f..0000000000 --- a/test/headers/Jamfile +++ /dev/null @@ -1,56 +0,0 @@ -# Boost.GIL (Generic Image Library) - tests -# -# Copyright (c) 2018 Mateusz Loskot -# Copyright (c) 2018 Dmitry Arkhipov -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or -# copy at http://www.boost.org/LICENSE_1_0.txt) - -import os ; -import path ; -import regex ; - -rule generate_self_contained_headers ( headers_subpath * : exclude_subpaths * ) -{ - # On CI services, test the self-contained headers on-demand only to avoid build timeouts - # CI environment is common for Travis CI, AppVeyor, CircleCI, etc. - # For example: - # if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ] { - # alias self_contained_headers : [ generate_self_contained_headers ] ; - # } - - local targets ; - - # NOTE: All '/' in test names are replaced with '-' because apparently - # test scripts have a problem with test names containing slashes. - - local top_headers_path = [ path.make $(BOOST_ROOT)/libs/gil/include/boost/gil ] ; - - for local file in [ path.glob-tree $(top_headers_path)/$(headers_subpath) : *.hpp : $(exclude_subpaths) ] - { - local rel_file = [ path.relative-to $(top_headers_path) $(file) ] ; - local target_name = [ regex.replace h/$(rel_file) "/" "-" ] ; - local target_name = [ regex.replace $(target_name) "\.hpp" "" ] ; - targets += [ - compile $(BOOST_ROOT)/libs/gil/test/headers/main.cpp - : "BOOST_GIL_TEST_HEADER=$(rel_file)" $(file) - : $(target_name) - ] ; - } - - return $(targets) ; -} - -# TODO: Review sorting to get as close as possible from general to specific - -# Core -alias concepts : [ generate_self_contained_headers concepts ] ; -alias core : [ generate_self_contained_headers : concepts extension io ] ; -alias io : [ generate_self_contained_headers io : concepts extension ] ; - -# Extensions -alias extension/dynamic_image : [ generate_self_contained_headers extension/dynamic_image ] ; -alias extension/io : [ generate_self_contained_headers extension/io ] ; -alias extension/numeric : [ generate_self_contained_headers extension/numeric ] ; -alias extension/toolbox : [ generate_self_contained_headers extension/toolbox ] ; diff --git a/test/legacy/CMakeLists.txt b/test/legacy/CMakeLists.txt index 875e8173d1..e1b1d0d749 100644 --- a/test/legacy/CMakeLists.txt +++ b/test/legacy/CMakeLists.txt @@ -13,7 +13,7 @@ # * Modify only if absolutely necessary (a bug found in the tests). # See the accompanying README.md # -message(STATUS "Boost.GIL: Configuring core tests") +message(STATUS "Boost.GIL: Configuring tests in test/legacy") foreach(_name channel