Commit Graph

29 Commits

Author SHA1 Message Date
MIRAL SHAH
716fe9ad8c Implement algorithms for binary and binary inverse thresholding (#313)
Add public functions threshold_binary and threshold_truncate.
Add tests and example.
Closes #310
2019-06-18 21:42:43 +02:00
Mateusz Łoskot
4ed7701b47
Move tests of extensions inside test/ directory (#302)
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).
2019-05-28 18:58:22 +02:00
Mateusz Łoskot
4dc3836449
[cmake] Rationalise names of tests vs targets 2019-05-23 01:15:44 +02:00
Mateusz Łoskot
c6c5336cc0
Value-initialize channel and pixel value members (#273)
Add tests to ensure member values of channel and pixel classes are
determined, zero-initialized.
Fixes #270

Tidy up formatting.
2019-04-01 17:19:22 +01:00
Mateusz Łoskot
61c23b0529
Add test for some channel, color and pixel metafunctions (#247) 2019-02-27 08:19:44 +01:00
Mateusz Łoskot
213b55c6ad
Add test for iterator concepts (#242) 2019-02-24 18:15:06 +00:00
Mateusz Łoskot
48db4f51a3
Add test for locator concepts (#241) 2019-02-23 11:16:57 +00:00
Mateusz Łoskot
8e7bda62f5
Move GIL's original test suites to test/legacy/ (#239)
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.
2019-02-20 19:03:28 +00:00
Mateusz Łoskot
e72e3862c2
Add tests for image_view metafunctions, image and pixel concepts (#236)
Rename test source files xxx_concepts.cpp to concepts.cpp
2019-02-18 21:52:30 +00:00
Mateusz Łoskot
6763a8cd98
Build core tests with BOOST_GIL_USE_CONCEPT_CHECK defined (#230)
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
2019-02-05 22:19:35 +00:00
Mateusz Łoskot
73edd31781
[cmake] Add GIL_BUILD_HEADERS_TESTS option [ci skip]
Allows to avoid generating lots of headers tests,
if unnecessary, e.g. while developing in IDE.
2019-01-05 23:01:37 +01:00
Mateusz Łoskot
e99db3d0c4
[cmake] Tidy up [ci skip] 2018-12-12 14:00:13 +01:00
Mateusz Łoskot
92cddb3f71
[cmake] Bundle all Boost and IO libraries in gil_dependencies target
Simplify generating of IO tests targets, remove lots of duplicate cruft.
Tidy up CMake scripts.
2018-12-08 23:20:54 +01:00
Mateusz Łoskot
b6e8dbbf8f
[cmake] Explain Boost regression not supposed to run headers tests [ci skip] 2018-12-08 15:59:04 +01:00
Mateusz Łoskot
2957351f57
Add self-contained header tests to CMake configuration [ci skip]
Similarly to the tests defined in Boost.Build configuration, those do
not run on CI builds or regression builds.
2018-12-08 02:40:45 +01:00
Mateusz Łoskot
63c450c2a9
Modernize CMake configuration
Replace global compile options and definitions with interface targets.
Remove globing for headers.
Set project version based on GIL version.
Remove GIL_BUILD_TESTS option as redundant - there is no point in
using CMake for development of header-only library if no tests
are to be built.
2018-12-08 01:05:47 +01:00
Mateusz Łoskot
5fd0f7878c [cmake] Prefix status messages with Boost.GIL for source clarity [ci skip]
Remove GIL_USE_BOOST_STAGE as unnecessary.
Download FindBoost.cmake for <3.13 - this module in CMake 3.13
received some important updates.
2018-10-29 14:01:48 +01:00
Mateusz Loskot
53dc1a6949
Add basic tests for point<T> (#156) 2018-10-20 16:35:29 +02:00
Mateusz Łoskot
9b89b4fd9d
[cmake] Add test/image_view to CMake configuration
[ci skip]
2018-10-20 00:07:56 +02:00
Mateusz Łoskot
9426683651
[cmake] Add CMakeLists.txt for test/algorithm
Do not link lightweight_test-based tests against Boost.Test libraries.
Tidy up.

[ci skip]
2018-10-19 23:50:30 +02:00
Mateusz Łoskot
bfb0c15323 [cmake] Update FindBoost.cmake auto-download instructions [ci skip]
Add GIL_DISABLE_FINDBOOST_DOWNLAOD option (default=OFF).
Output values of Boost_INCLUDE_DIRS and BOOST_LIBRARY_DIRS
  - should help to know which Boost we are building GIL against.
Fix add_executable with empty sources list.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
b8af11db87 Add promote_integral metafunction
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.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
73ec99e606 Refactor single-program channel test to Boost.Test suites and cases
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.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
1e89c764b2 [cmake] Replicate GCC/clang compile flags from Jamfile
Add headers to target sources, so they are included in generate
makefiles, scanned and inspected as regular sources.

[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
fab99207f2 Add basic CMake configuration for Boost.GIL
First stab at collection of CMakeLists.txt for Boost.GIL
  - Allow building and testing boostorg/gil against Boost from
    cloned superproject or installed distribution.
Add CMakeSettings.json config file for VS2017 integration with CMake
  - Defines build configurations for VS and Ninja generators.
  - Can be used as is or as a template ready to customise.
Add conanfile.txt for Conan package manager (eg. for cmake -DGIL_USE_CONAN=ON).
Add .editignore file to with basic encoding of CMake and CI scripts.
Update .appveyor.yml with two extra CMake-based builds (allowed to fail).
2018-06-27 00:02:27 -04:00
Troy D. Straszheim
6c4bc7af41 rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release.
[SVN r56941]
2009-10-17 01:10:45 +00:00
Troy D. Straszheim
4cc46fd8f6 Add basic copyright/license to keep cmake out of the inspection report
[SVN r55095]
2009-07-22 21:51:01 +00:00
Douglas Gregor
afcd17e92f Fix GIL image test for CMake
[SVN r52893]
2009-05-11 03:11:03 +00:00
Troy D. Straszheim
44871518f5 merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00