fabscript 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. from faber import platform
  10. from faber.feature import set
  11. from faber.tools.compiler import define, libs
  12. from faber.artefacts.binary import binary
  13. from faber.test import test, report, fail
  14. boost_suffix = options.get_with('boost-suffix')
  15. boost_suffix = '-' + boost_suffix if boost_suffix else ''
  16. boost_filesystem = 'boost_filesystem' + boost_suffix
  17. boost_system = 'boost_system' + boost_suffix
  18. test_features = set(libs(boost_filesystem, boost_system))
  19. def gil_test(name, sources, features):
  20. return test(name, binary(name, sources, features=features))
  21. tests = [gil_test('image',
  22. ['image.cpp', 'sample_image.cpp', 'error_if.cpp'],
  23. features=test_features),
  24. gil_test('channel', ['channel.cpp', 'error_if.cpp'],
  25. features=test_features),
  26. gil_test('pixel', ['pixel.cpp', 'error_if.cpp'],
  27. features=test_features),
  28. gil_test('pixel_iterator', ['pixel_iterator.cpp', 'error_if.cpp'],
  29. features=test_features)]
  30. default = report('report', tests, fail_on_failures=True)