• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# -*- python -*-
2#
3# Copyright (c) 2017 Stefan Seefeld
4# All rights reserved.
5#
6# Distributed under the Boost Software License, Version 1.0.
7# (See accompanying file LICENSE_1_0.txt or copy at
8# http://www.boost.org/LICENSE_1_0.txt)
9
10from faber import platform
11from faber.feature import set
12from faber.tools.compiler import define, libs, linkpath
13from faber.artefacts.binary import binary
14from faber.test import test, report, fail
15from os.path import join
16
17boost_suffix = options.get_with('boost-suffix')
18boost_suffix = '-' + boost_suffix if boost_suffix else ''
19boost_unit_test_framework = 'boost_unit_test_framework' + boost_suffix
20boost_filesystem = 'boost_filesystem' + boost_suffix
21boost_system = 'boost_system' + boost_suffix
22
23test_features = set(define('BOOST_TEST_DYN_LINK'),
24                    libs(boost_unit_test_framework,
25                         boost_system,
26                         boost_filesystem))
27
28
29def gil_test(name, sources, features, condition=True):
30    return test(name, binary(name, sources, features=features, condition=condition))
31
32
33# TODO: Add `subchroma_image.cpp` after fixing run-time failure,
34#       for details see https://github.com/boostorg/gil/pull/164
35tests = [gil_test('toolbox',
36                  ['test.cpp', 'channel_type.cpp', 'channel_view.cpp', 'cmyka.cpp',
37                   'get_num_bits.cpp', 'get_pixel_type.cpp', 'gray_alpha.cpp', 'gray_to_rgba.cpp',
38                   'hsl_hsv_test.cpp', 'indexed_image_test.cpp', 'is_bit_aligned.cpp',
39                   'is_homogeneous.cpp', 'is_similar.cpp', 'lab_test.cpp', 'pixel_bit_size.cpp',
40                   'rgb_to_luminance.cpp', 'xyz_test.cpp'],
41                  features=test_features),
42]
43
44default = report('report', tests, fail_on_failures=True)
45