diff --git a/pstl/test/CMakeLists.txt b/pstl/test/CMakeLists.txt index 338149774957..dae99e129be1 100644 --- a/pstl/test/CMakeLists.txt +++ b/pstl/test/CMakeLists.txt @@ -18,6 +18,10 @@ add_custom_target(check-pstl 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 @@ foreach(_file IN LISTS UNIT_TESTS) 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 index 0b0d79b5b237..935c7e508605 100644 --- 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 index e346a3bc6bab..e1057e941918 100644 --- 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 index 1a8a117ac586..9304d0c965c4 100644 --- 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 index 2e3432370423..ff767c71bfb1 100644 --- 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 index 1ff596eee512..04725e9df368 100644 --- 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 index 3c5b8cf8989f..db38fbd928b5 100644 --- 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 index 2ba7457219ba..7a8d065f0dec 100644 --- 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 index 20e3a0d50549..b215beb10af4 100644 --- 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 index 2a915ca98936..d2bb83b63270 100644 --- 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 index b1880f1d94c1..874595f2f142 100644 --- 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 index 0203fff85c69..716f6dd3e32d 100644 --- 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 index e9ae0ee20e93..dfb76e3321cb 100644 --- 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 index 79b53d19581f..9d4615c356e2 100644 --- 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 index c8569a647958..3edd3e875996 100644 --- 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 index c54d97ac9edf..18ba11b1c5d5 100644 --- 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 index 19bc150b31b6..d54a7defb651 100644 --- 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 index 9862f14ba629..9b423df29330 100644 --- 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 index 5a5404f9bff4..010e3c6f6164 100644 --- 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 index 0437292af4fc..1dabb811fe90 100644 --- 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 index 7784d386423e..9f172a4b97ab 100644 --- 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 index e4a147b94753..b6700f13e217 100644 --- 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 index 64f6a035ac86..08241ac39e4d 100644 --- 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 index 3660e9d31810..3b1ce81b6ef4 100644 --- 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 index b53003c46260..1f4031b4f31e 100644 --- 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 index d44284de4e50..e440d6708c8e 100644 --- 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 index eae992c4111c..48e3db4866d5 100644 --- 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 index 92a9cddabd6b..dc1e38bcf389 100644 --- 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 index 9161fff22b5e..a3adb20bfc73 100644 --- 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 index 50b01e38bc16..1bccb5302542 100644 --- 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 index f73166e917e6..2ad0c579755c 100644 --- 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 index 8d330c2487d4..9e8cbe56e87c 100644 --- 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 index 04b0f52e6c3a..e1c649dacbe4 100644 --- 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 index 8ddadb874cdd..ea4c09ec18d3 100644 --- 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 index 8d7cc025e0c8..a5d5b8567de1 100644 --- 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 index a9b04f82f546..dfe499c3d1ec 100644 --- 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 index eb67c2f47817..f0903313f0f1 100644 --- 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 index 06763b169586..b0f165d5df30 100644 --- 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 index cb0fa06dcdad..00e04f262276 100644 --- 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 index ec34af08fb0f..f0f61ca10e22 100644 --- 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 index 8ca113c1ae22..3abf7e3bd927 100644 --- 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 index 7aee86260df9..61fe8d7049d0 100644 --- 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 index 846140afdcce..28fcb36ad80b 100644 --- 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 index adfe96e70c19..bfee4bdffda4 100644 --- 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 index 7adadd52417d..cdfca24af72e 100644 --- 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 index e3fec8683755..01016b898a54 100644 --- 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 index fff2284fe032..431ce0d11cdb 100644 --- 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 index 6d8c0891ff7d..dbe59d02adf8 100644 --- 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 index a5219f796691..e7d84f1441a4 100644 --- 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 index 54d30abeeccb..701fee2e8676 100644 --- 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 index 44a2a9991be2..6045176e217c 100644 --- 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 index e2eb9cecd2df..1997ec56c8b6 100644 --- 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 index 4d05c33c578c..eb3a48ec3344 100644 --- 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 index d4709c5ee1b2..83efe032feb7 100644 --- 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 index eafffcc39f55..6ae02f18b273 100644 --- 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 index 792190a9724f..4065e722309d 100644 --- 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 index 282bf3448a8c..748da917123b 100644 --- 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 index 0e6e0c0f0343..50c9db17bac7 100644 --- 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 index ce3ee1a33ad7..979c2e59e1a1 100644 --- 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 index 12301f014e15..a57afcc5211a 100644 --- 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 similarity index 67% rename from pstl/include/pstl/algorithm rename to pstl/test/support/stdlib/algorithm index 684f8eaa2e86..39e6f7471a6d 100644 --- 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 similarity index 68% rename from pstl/include/pstl/execution rename to pstl/test/support/stdlib/execution index 333c61fbb171..ad18c450115a 100644 --- 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 @@ using namespace __pstl::execution; } } // namespace pstl -#endif /* _PSTL_EXECUTION */ +#endif /* _TEST_SUPPORT_STDLIB_EXECUTION */ diff --git a/pstl/include/pstl/memory b/pstl/test/support/stdlib/memory similarity index 68% rename from pstl/include/pstl/memory rename to pstl/test/support/stdlib/memory index 359eaf19f3b1..7d1109122967 100644 --- 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 similarity index 68% rename from pstl/include/pstl/numeric rename to pstl/test/support/stdlib/numeric index 94e9b76dc17d..8f98bc754643 100644 --- 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 */