]>
Commit | Line | Data |
---|---|---|
92f5a8d4 TL |
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 | ||
10 | from faber import platform | |
11 | from faber.feature import set | |
12 | from faber.tools.compiler import define, libs, linkpath | |
13 | from faber.artefacts.binary import binary | |
14 | from faber.test import test, report, fail | |
15 | from os.path import join | |
16 | ||
17 | boost_suffix = options.get_with('boost-suffix') | |
18 | boost_suffix = '-' + boost_suffix if boost_suffix else '' | |
19 | boost_unit_test_framework = 'boost_unit_test_framework' + boost_suffix | |
20 | boost_filesystem = 'boost_filesystem' + boost_suffix | |
21 | boost_system = 'boost_system' + boost_suffix | |
22 | ||
23 | test_features = set(define('BOOST_TEST_DYN_LINK'), | |
24 | libs(boost_unit_test_framework, | |
25 | boost_system, | |
26 | boost_filesystem)) | |
27 | ||
28 | without_jpeg = options.get_without('jpeg') | |
29 | jpeg_features = test_features + set(libs('jpeg')) | |
30 | jpeg_prefix = options.get_with('jpeg-prefix') | |
31 | if jpeg_prefix: | |
32 | jpeg_features += include(join(jpeg_prefix, 'include')) | |
33 | jpeg_features += linkpath(join(jpeg_prefix, 'lib64'), join(jpeg_prefix, 'lib')) | |
34 | ||
35 | without_png = options.get_without('png') | |
36 | png = options.get_with('png') or 'png' # on some platforms the library uses another name | |
37 | png_features = test_features + set(libs(png)) | |
38 | png_prefix = options.get_with('png-prefix') | |
39 | if png_prefix: | |
40 | png_features += include(join(png_prefix, 'include')) | |
41 | png_features += linkpath(join(png_prefix, 'lib64'), join(png_prefix, 'lib')) | |
42 | ||
43 | without_tiff = options.get_without('tiff') | |
44 | tiff_features = test_features + set(libs('tiff')) | |
45 | tiff_prefix = options.get_with('tiff-prefix') | |
46 | if tiff_prefix: | |
47 | tiff_features += include(join(tiff_prefix, 'include')) | |
48 | tiff_features += linkpath(join(tiff_prefix, 'lib64'), join(tiff_prefix, 'lib')) | |
49 | ||
50 | ||
51 | def gil_test(name, sources, features, condition=True): | |
52 | return test(name, binary(name, sources, features=features, condition=condition)) | |
53 | ||
54 | ||
55 | tests = [gil_test('all_formats_test', ['all_formats_test.cpp'], features=test_features | png_features | jpeg_features), | |
56 | gil_test('bmp', | |
57 | ['bmp_test.cpp', 'bmp_old_test.cpp', 'bmp_read_test.cpp', 'bmp_write_test.cpp'], | |
58 | features=test_features), | |
59 | gil_test('jpeg', ['jpeg_test.cpp', 'jpeg_old_test.cpp', 'jpeg_read_test.cpp', 'jpeg_write_test.cpp'], | |
60 | features=jpeg_features, | |
61 | condition=not without_jpeg), | |
62 | gil_test('png', ['png_test.cpp', 'png_old_test.cpp', 'png_file_format_test.cpp', 'png_read_test.cpp'], | |
63 | features=png_features, | |
64 | condition=not without_png), | |
65 | gil_test('pnm', ['pnm_test.cpp', 'pnm_old_test.cpp', 'pnm_read_test.cpp', 'pnm_write_test.cpp'], | |
66 | features=test_features), | |
67 | gil_test('targa', ['targa_test.cpp', 'targa_old_test.cpp', 'targa_read_test.cpp', 'targa_write_test.cpp'], | |
68 | features=test_features), | |
69 | gil_test('tiff', ['tiff_test.cpp', | |
70 | 'tiff_old_test.cpp', | |
71 | 'tiff_file_format_test.cpp', | |
72 | 'tiff_tiled_float_test.cpp', | |
73 | 'tiff_tiled_minisblack_test_1-10.cpp', | |
74 | 'tiff_tiled_minisblack_test_11-20.cpp', | |
75 | 'tiff_tiled_minisblack_test_21-31_32-64.cpp', | |
76 | 'tiff_tiled_minisblack_write_test_1-10.cpp', | |
77 | 'tiff_tiled_minisblack_write_test_11-20.cpp', | |
78 | 'tiff_tiled_minisblack_write_test_21-31_32-64.cpp', | |
79 | 'tiff_tiled_palette_test_1-8.cpp', | |
80 | 'tiff_tiled_palette_test_8-16.cpp', | |
81 | 'tiff_tiled_palette_write_test_1-8.cpp', | |
82 | 'tiff_tiled_palette_write_test_8-16.cpp', | |
83 | 'tiff_tiled_rgb_contig_test_1-10.cpp', | |
84 | 'tiff_tiled_rgb_contig_test_11-20.cpp', | |
85 | 'tiff_tiled_rgb_contig_test_21-31_32_64.cpp', | |
86 | 'tiff_tiled_rgb_contig_write_test_1-10.cpp', | |
87 | 'tiff_tiled_rgb_contig_write_test_11-20.cpp', | |
88 | 'tiff_tiled_rgb_contig_write_test_21-31_32_64.cpp', | |
89 | 'tiff_tiled_rgb_planar_test_1-10.cpp', | |
90 | 'tiff_tiled_rgb_planar_test_11-20.cpp', | |
91 | 'tiff_tiled_rgb_planar_test_21-31_32_64.cpp', | |
92 | 'tiff_tiled_test.cpp', | |
93 | 'tiff_write_test.cpp'], | |
94 | features=tiff_features, | |
95 | condition=not without_tiff) | |
96 | ] | |
97 | ||
98 | default = report('report', tests, fail_on_failures=True) |