# Copyright (c) 2019 The STE||AR-Group
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

include(HPX_Message)
include(HPX_Option)

if(HPX_WITH_TESTS)
  if(HPX_WITH_TESTS_UNIT)
    add_hpx_pseudo_target(tests.unit.modules.async_combinators)
    add_hpx_pseudo_dependencies(
      tests.unit.modules tests.unit.modules.async_combinators
    )
    add_subdirectory(unit)
  endif()

  if(HPX_WITH_TESTS_REGRESSIONS)
    add_hpx_pseudo_target(tests.regressions.modules.async_combinators)
    add_hpx_pseudo_dependencies(
      tests.regressions.modules tests.regressions.modules.async_combinators
    )
    add_subdirectory(regressions)
  endif()

  if(HPX_WITH_TESTS_BENCHMARKS)
    add_hpx_pseudo_target(tests.performance.modules.async_combinators)
    add_hpx_pseudo_dependencies(
      tests.performance.modules tests.performance.modules.async_combinators
    )
    add_subdirectory(performance)
  endif()

  if(HPX_WITH_TESTS_HEADERS)
    # This header is excluded as it's not complete on it's own. It requires the
    # future_then_dispatch specializations from the execution module, which
    # depends on async_combinators.
    set(excluded_headers hpx/async_combinators/split_future.hpp)
    add_hpx_header_tests(
      modules.async_combinators
      HEADERS ${async_combinators_headers}
      EXCLUDE ${excluded_headers}
      HEADER_ROOT ${PROJECT_SOURCE_DIR}/include
      NOLIBS
      DEPENDENCIES hpx_async_combinators
    )
  endif()
endif()
