diff --git a/pstl/test/CMakeLists.txt b/pstl/test/CMakeLists.txt --- a/pstl/test/CMakeLists.txt +++ b/pstl/test/CMakeLists.txt @@ -18,6 +18,10 @@ DEPENDS pstl-build-tests COMMENT "Build and run all the unit tests.") +add_library(test_stdlib INTERFACE) +target_include_directories(test_stdlib INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/support/stdlib") +target_link_libraries(test_stdlib INTERFACE pstl::ParallelSTL) + file(GLOB_RECURSE UNIT_TESTS "*.pass.cpp") foreach(_file IN LISTS UNIT_TESTS) file(RELATIVE_PATH _target "${CMAKE_CURRENT_SOURCE_DIR}" "${_file}") @@ -27,8 +31,7 @@ add_executable(${_target} EXCLUDE_FROM_ALL "${_file}") target_include_directories(${_target} PRIVATE "${CMAKE_CURRENT_LIST_DIR}") - target_link_libraries(${_target} PRIVATE pstl::ParallelSTL) - target_compile_definitions(${_target} PRIVATE -DPSTL_STANDALONE_TESTS) + target_link_libraries(${_target} PRIVATE test_stdlib) set_target_properties(${_target} PROPERTIES CXX_EXTENSIONS NO RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") add_test(${_target} "${CMAKE_CURRENT_BINARY_DIR}/${_target}") diff --git a/pstl/test/pstl/header_inclusion_order_algorithm_0.pass.cpp b/pstl/test/pstl/header_inclusion_order_algorithm_0.pass.cpp --- a/pstl/test/pstl/header_inclusion_order_algorithm_0.pass.cpp +++ b/pstl/test/pstl/header_inclusion_order_algorithm_0.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS int32_t main() diff --git a/pstl/test/pstl/header_inclusion_order_algorithm_1.pass.cpp b/pstl/test/pstl/header_inclusion_order_algorithm_1.pass.cpp --- a/pstl/test/pstl/header_inclusion_order_algorithm_1.pass.cpp +++ b/pstl/test/pstl/header_inclusion_order_algorithm_1.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/algorithm" -#include "pstl/execution" -#else #include #include -#endif // PSTL_STANDALONE_TESTS int32_t main() diff --git a/pstl/test/pstl/header_inclusion_order_memory_0.pass.cpp b/pstl/test/pstl/header_inclusion_order_memory_0.pass.cpp --- a/pstl/test/pstl/header_inclusion_order_memory_0.pass.cpp +++ b/pstl/test/pstl/header_inclusion_order_memory_0.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/memory" -#else #include #include -#endif // PSTL_STANDALONE_TESTS int32_t main() diff --git a/pstl/test/pstl/header_inclusion_order_memory_1.pass.cpp b/pstl/test/pstl/header_inclusion_order_memory_1.pass.cpp --- a/pstl/test/pstl/header_inclusion_order_memory_1.pass.cpp +++ b/pstl/test/pstl/header_inclusion_order_memory_1.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/memory" -#include "pstl/execution" -#else #include #include -#endif // PSTL_STANDALONE_TESTS int32_t main() diff --git a/pstl/test/pstl/header_inclusion_order_numeric_0.pass.cpp b/pstl/test/pstl/header_inclusion_order_numeric_0.pass.cpp --- a/pstl/test/pstl/header_inclusion_order_numeric_0.pass.cpp +++ b/pstl/test/pstl/header_inclusion_order_numeric_0.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/numeric" -#else #include #include -#endif // PSTL_STANDALONE_TESTS int32_t main() diff --git a/pstl/test/pstl/header_inclusion_order_numeric_1.pass.cpp b/pstl/test/pstl/header_inclusion_order_numeric_1.pass.cpp --- a/pstl/test/pstl/header_inclusion_order_numeric_1.pass.cpp +++ b/pstl/test/pstl/header_inclusion_order_numeric_1.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/numeric" -#include "pstl/execution" -#else #include #include -#endif // PSTL_STANDALONE_TESTS int32_t main() diff --git a/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp b/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp --- a/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp +++ b/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp @@ -9,15 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include -#include "pstl/execution" -#include "pstl/algorithm" - -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.merge/merge.pass.cpp b/pstl/test/std/algorithms/alg.merge/merge.pass.cpp --- a/pstl/test/std/algorithms/alg.merge/merge.pass.cpp +++ b/pstl/test/std/algorithms/alg.merge/merge.pass.cpp @@ -9,16 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include -#include -#include "pstl/execution" -#include "pstl/algorithm" - -#else #include #include -#endif // PSTL_STANDALONE_TESTS +#include #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp @@ -10,13 +10,8 @@ // Tests for copy_if and remove_copy_if #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp @@ -10,19 +10,13 @@ // Tests for stable_partition and partition #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS - -#include "support/utils.h" - #include #include +#include "support/utils.h" + using namespace TestUtils; template diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp @@ -10,19 +10,13 @@ // Tests for stable_partition and partition_copy #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS - -#include "support/utils.h" - #include #include +#include "support/utils.h" + using namespace TestUtils; struct test_partition_copy diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp @@ -9,15 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS #include - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp @@ -9,15 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS #include - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp @@ -11,13 +11,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp @@ -9,14 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp @@ -9,15 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS #include - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp @@ -10,13 +10,8 @@ // Test for remove, remove_if #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp @@ -9,14 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp @@ -11,13 +11,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp @@ -9,15 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS #include - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/rotate_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/rotate_copy.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/rotate_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/rotate_copy.pass.cpp @@ -9,15 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS #include - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp @@ -9,15 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS #include - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/transform_unary.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/transform_unary.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/transform_unary.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/transform_unary.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/unique.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/unique.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/unique.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/unique.pass.cpp @@ -10,13 +10,8 @@ // Test for unique #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp --- a/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp @@ -10,13 +10,8 @@ // Tests for unique_copy #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/adjacent_find.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/adjacent_find.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/adjacent_find.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/adjacent_find.pass.cpp @@ -9,14 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp @@ -10,13 +10,8 @@ // Tests for count and count_if #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/equal.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/equal.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/equal.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/equal.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp @@ -10,13 +10,8 @@ // Tests for find #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find_if.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find_if.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/find_if.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find_if.pass.cpp @@ -10,13 +10,8 @@ // Tests for find_if and find_if_not #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/for_each.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/for_each.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/for_each.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/for_each.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/mismatch.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/mismatch.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/mismatch.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/mismatch.pass.cpp @@ -9,17 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - -#include "pstl/execution" -#include "pstl/algorithm" -#include "pstl/numeric" -#include "pstl/memory" - -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp @@ -9,16 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include #include -#include "pstl/execution" -#include "pstl/algorithm" - -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp --- a/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp --- a/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp @@ -10,13 +10,8 @@ // Tests for is_heap, is_heap_until #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" #include diff --git a/pstl/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp --- a/pstl/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp @@ -9,15 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS #include - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp --- a/pstl/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp @@ -9,21 +9,14 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS - -#include "support/utils.h" - #include #include #include +#include "support/utils.h" + using namespace TestUtils; struct check_minelement diff --git a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp --- a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp @@ -9,16 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - #include - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp --- a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp @@ -9,17 +9,10 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - #include #include - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp b/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp --- a/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp @@ -9,14 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp b/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp --- a/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp @@ -9,16 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - #include - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp b/pstl/test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp --- a/pstl/test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp @@ -9,16 +9,11 @@ // Tests for partial_sort_copy -#include #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/algorithm" -#else +#include #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp b/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp --- a/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp @@ -9,14 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - -#include "pstl/execution" -#include "pstl/algorithm" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp b/pstl/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp --- a/pstl/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp +++ b/pstl/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp @@ -9,16 +9,9 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS #include - -#include "pstl/execution" -#include "pstl/algorithm" -#include "pstl/numeric" -#else #include -#include -#endif // PSTL_STANDALONE_TESTS +#include #include "support/utils.h" diff --git a/pstl/test/std/numerics/numeric.ops/reduce.pass.cpp b/pstl/test/std/numerics/numeric.ops/reduce.pass.cpp --- a/pstl/test/std/numerics/numeric.ops/reduce.pass.cpp +++ b/pstl/test/std/numerics/numeric.ops/reduce.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/numeric" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/numerics/numeric.ops/scan.pass.cpp b/pstl/test/std/numerics/numeric.ops/scan.pass.cpp --- a/pstl/test/std/numerics/numeric.ops/scan.pass.cpp +++ b/pstl/test/std/numerics/numeric.ops/scan.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/numeric" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/numerics/numeric.ops/transform_reduce.pass.cpp b/pstl/test/std/numerics/numeric.ops/transform_reduce.pass.cpp --- a/pstl/test/std/numerics/numeric.ops/transform_reduce.pass.cpp +++ b/pstl/test/std/numerics/numeric.ops/transform_reduce.pass.cpp @@ -9,14 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - -#include "pstl/execution" -#include "pstl/numeric" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/numerics/numeric.ops/transform_scan.pass.cpp b/pstl/test/std/numerics/numeric.ops/transform_scan.pass.cpp --- a/pstl/test/std/numerics/numeric.ops/transform_scan.pass.cpp +++ b/pstl/test/std/numerics/numeric.ops/transform_scan.pass.cpp @@ -9,13 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/numeric" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_construct.pass.cpp b/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_construct.pass.cpp --- a/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_construct.pass.cpp +++ b/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_construct.pass.cpp @@ -12,13 +12,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/memory" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp b/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp --- a/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp +++ b/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp @@ -11,13 +11,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS -#include "pstl/execution" -#include "pstl/memory" -#else #include #include -#endif // PSTL_STANDALONE_TESTS #include "support/utils.h" diff --git a/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_fill_destroy.pass.cpp b/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_fill_destroy.pass.cpp --- a/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_fill_destroy.pass.cpp +++ b/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_fill_destroy.pass.cpp @@ -9,15 +9,8 @@ #include "support/pstl_test_config.h" -#ifdef PSTL_STANDALONE_TESTS - -#include "pstl/execution" -#include "pstl/memory" -#include "pstl/algorithm" -#else #include -#include -#endif // PSTL_STANDALONE_TESTS +#include #include "support/utils.h" diff --git a/pstl/include/pstl/algorithm b/pstl/test/support/stdlib/algorithm rename from pstl/include/pstl/algorithm rename to pstl/test/support/stdlib/algorithm --- a/pstl/include/pstl/algorithm +++ b/pstl/test/support/stdlib/algorithm @@ -7,18 +7,20 @@ // //===----------------------------------------------------------------------===// -#ifndef _PSTL_ALGORITHM -#define _PSTL_ALGORITHM +#ifndef _TEST_SUPPORT_STDLIB_ALGORITHM +#define _TEST_SUPPORT_STDLIB_ALGORITHM -#include "internal/pstl_config.h" +#include_next + +#include #if _PSTL_EXECUTION_POLICIES_DEFINED // If has already been included, pull in implementations -# include "internal/glue_algorithm_impl.h" +# include #else // Otherwise just pull in forward declarations -# include "internal/glue_algorithm_defs.h" +# include # define _PSTL_ALGORITHM_FORWARD_DECLARED 1 #endif -#endif /* _PSTL_ALGORITHM */ +#endif /* _TEST_SUPPORT_STDLIB_ALGORITHM */ diff --git a/pstl/include/pstl/execution b/pstl/test/support/stdlib/execution rename from pstl/include/pstl/execution rename to pstl/test/support/stdlib/execution --- a/pstl/include/pstl/execution +++ b/pstl/test/support/stdlib/execution @@ -7,30 +7,32 @@ // //===----------------------------------------------------------------------===// -#ifndef _PSTL_EXECUTION -#define _PSTL_EXECUTION +#ifndef _TEST_SUPPORT_STDLIB_EXECUTION +#define _TEST_SUPPORT_STDLIB_EXECUTION -#include "internal/pstl_config.h" -#include "internal/execution_defs.h" +// #include_next // None of the standard libraries PSTL is built on top have the header yet. + +#include +#include #define _PSTL_EXECUTION_POLICIES_DEFINED 1 #if _PSTL_ALGORITHM_FORWARD_DECLARED -# include "internal/glue_algorithm_impl.h" +# include #endif #if _PSTL_MEMORY_FORWARD_DECLARED -# include "internal/glue_memory_impl.h" +# include #endif #if _PSTL_NUMERIC_FORWARD_DECLARED -# include "internal/glue_numeric_impl.h" +# include #endif #if _PSTL_CPP17_EXECUTION_POLICIES_PRESENT _PSTL_PRAGMA_MESSAGE_POLICIES("The execution policies are defined in the namespace __pstl::execution") #else -# include "internal/glue_execution_defs.h" +# include _PSTL_PRAGMA_MESSAGE_POLICIES( "The execution policies are injected into the standard namespace std::execution") #endif @@ -45,4 +47,4 @@ } } // namespace pstl -#endif /* _PSTL_EXECUTION */ +#endif /* _TEST_SUPPORT_STDLIB_EXECUTION */ diff --git a/pstl/include/pstl/memory b/pstl/test/support/stdlib/memory rename from pstl/include/pstl/memory rename to pstl/test/support/stdlib/memory --- a/pstl/include/pstl/memory +++ b/pstl/test/support/stdlib/memory @@ -7,18 +7,20 @@ // //===----------------------------------------------------------------------===// -#ifndef _PSTL_MEMORY -#define _PSTL_MEMORY +#ifndef _TEST_SUPPORT_STDLIB_MEMORY +#define _TEST_SUPPORT_STDLIB_MEMORY -#include "internal/pstl_config.h" +#include_next + +#include #if _PSTL_EXECUTION_POLICIES_DEFINED // If has already been included, pull in implementations -# include "internal/glue_memory_impl.h" +# include #else // Otherwise just pull in forward declarations -# include "internal/glue_memory_defs.h" +# include # define _PSTL_MEMORY_FORWARD_DECLARED 1 #endif -#endif /* _PSTL_MEMORY */ +#endif /* _TEST_SUPPORT_STDLIB_MEMORY */ diff --git a/pstl/include/pstl/numeric b/pstl/test/support/stdlib/numeric rename from pstl/include/pstl/numeric rename to pstl/test/support/stdlib/numeric --- a/pstl/include/pstl/numeric +++ b/pstl/test/support/stdlib/numeric @@ -7,18 +7,20 @@ // //===----------------------------------------------------------------------===// -#ifndef _PSTL_NUMERIC -#define _PSTL_NUMERIC +#ifndef _TEST_SUPPORT_STDLIB_NUMERIC +#define _TEST_SUPPORT_STDLIB_NUMERIC -#include "internal/pstl_config.h" +#include_next + +#include #if _PSTL_EXECUTION_POLICIES_DEFINED // If has already been included, pull in implementations -# include "internal/glue_numeric_impl.h" +# include #else // Otherwise just pull in forward declarations -# include "internal/glue_numeric_defs.h" +# include # define _PSTL_NUMERIC_FORWARD_DECLARED 1 #endif -#endif /* _PSTL_NUMERIC */ +#endif /* _TEST_SUPPORT_STDLIB_NUMERIC */