Split header tests accordingly i.e. test core headers as part of
core tests, numeric extension headers as part of numeric tests, etc.
It extends the convention of sub-directories already established in
`include/boost/gil` directory. It is sensible to follow it in other
areas of the source tree (i.e. `test/`, `doc/` and `benchmark/`).
Another important reason to move the tests is to enable removal of
the top-level `Jamfile` with all its definitions of test-specific
requirements.
The top-level `Jamfile` is not advised, especially if it specifies
build requirements like C++ language version.
Those affect non-tests builds e.g. documentation, causing failures
during generation of HTML documentation (leads to missing docs).
(cherry picked from develop branch commit 4ed7701b47)
Document maintenance rules of `test/legacy/` content.
Motivation to move the `test/legacy/` is to:
* clarify status of those tests
* make it easier to run tests selectively
* separate new/upcoming feature-specific tests
from those all-in-one tests.
Other changes:
Rename `gil_test_common.hpp` to `unit_test.hpp` to make
it clearer it acts as `boost/test/unit_test.hpp proxy`.
Remove `<include>$(BOOST_ROOT)` from `Jamfile`-s as unnecessary.
Rename custom variant with gil_ prefix.
Do not define project ID from Jamfile-s as unnecessary.
The project ID-s and build features are global resources, easy to clash.
Add recently added test/ subdirectories to build.
when building tests with both, Boost.Build and CMake.
Disable concepts check for tests where range (e.g. std::array)
used as image pixel - not fully specialised as acceptable pixel type.
Ignore warnings from boost/concept_check.hpp
Rationalise uses of GCC and clang diagnostic push/pop,
with adding constraint for GCC 4.6+ as minimum version
where the pragma was introduced.
Closes#228
The linked variant of the Boost.UTF seems recommended.
It may help to avoid mysterious run-time error on Mac OS:
boost::runtime::access_to_missing_argument:
There is no argument provided for parameter color_output
It also may speed up compilation during CI builds.
For each header, a translation unit is generated along with
corresponding compile target.
Currently, only boost/gil/*.hpp and boost/gil/io/* headres are included.
On CI services, compile self_contained_headers targets only if
TEST_HEADERS environment variable is set. This is to avoid build
timeouts due to CI services limits.
When running b2 locally, the tests are compiled by default.
* Apply patch from https://svn.boost.org/trac10/ticket/8896
* Add compile-time test of RandomAccessNDImageViewConcept
* Confirms the reported failure (tested with GCC 7.3 and clang 5.0)
* Verifies correctness of the patch
Copied from Boost.Geometry, including original tests, with some non-functional
modifications explained in the comments.
The utility can be used where it is important to avoid integer overflow.
Motivation:
- state clearly what is covered with tests without reading non-trivial code
- avoid cleverness - tests should be no-brainer
- get closer to one test case targets one feature/beaviour with one check
- replace obscure `throw std::exception` with diagnostics that are actually
useful to pin-point failure cause and location - makes CI logs useful.
- allow to select and run specific tests
- make tests maintenance easy, quick and fun
Propose new structure of tests that reflects the previous tests hierarchy,
but organizes channel tests in test/channel directory with test programs
each covering specific library feature (or set of closely related features).
The refactored tests cover 100% of checks from the old `channel.cpp`,
plus it refines or adds a bunch more.
NOTE: old test/channel.cpp has not been removed yet.
Common definitions from the single test/channel.cpp moved to
channel_test_fixtures.hpp and namespace boost::gil::test::fixture:
Classes and typedefs:
- `do_test` as `fixture::channel`
- `value_core` as `fixture::channel_value`
- `reference_core` as `fixture::channel_reference`
- `packed_reference_core` as `fixture::packed_channel_reference`
- `packed_dynamic_reference_core` as `fixture::packed_dynamic_channel_reference`
- `channel_archetype` and relatives to `channel_concepts.cpp` which is compile
test in Jamfile
- `test_packed_channel_reference()` parts as `fixture::packed_channels565`
- `test_packed_dynamic_channel_reference()` parts as `fixture::packed_dynamic_channels565`
Test case functions called from `do_test<T>::test_all`:
- `test_channel_invert()` to `algorithm_channel_invert.cpp` suite
- `test_channel_convert()` to `algorithm_channel_convert.cpp` suite
- `test_channel_multiply()` to `algorithm_channel_multiply.cpp` suite
- `test_channel_math()` split to `algorithm_channel_relation.cpp`
and `algorithm_channel_arithmetic.cpp`
Add test cases for each channel value type T as used to run from
`test_channel_value_impl<T>`, `test_packed_channel_reference<T>` and
`test_packed_dynamic_channel_reference<T>`.
Add list of possible T-s defined as type-lists `fixture::channel_byte_types`,
`fixture::channel_integer_types`, `channel_float_types` and
`channel_bitfield_types` which used with `BOOST_AUTO_TEST_CASE_TEMPLATE`
generate all possible combination of inputs.
Add new `channel_test_fixture.cpp` is a self-test suite verifying the fixtures.
This enables test runners to copy the file to the target. It also makes
the code that looks for the file in a different path unnecessary since
Boost.Build will pass the proper relative path.
Bump MSVC warning level to W4
Preparing for detailed warnings clean up based on:
https://svn.boost.org/trac10/wiki/Guidelines/WarningsGuidelines
Group compilation flags and defines in common top-level Jamfile
- relies on Boost.Build feature of referring parent Jamfile-s.