Restructure test suite to follow libc++ standard layout

Summary: Subsumes changes requested in https://reviews.llvm.org/D59110

Reviewers: EricWF, ldionne

Subscribers: mgorny, krytarowski, jfb, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59856

llvm-svn: 357124
GitOrigin-RevId: 3b62047b8b2209bed57d239f581bdbfc91a10b94
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47fcab2..bbfac36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,11 +31,13 @@
 add_library(pstl::ParallelSTL ALIAS ParallelSTL)
 
 if (PARALLELSTL_USE_PARALLEL_POLICIES)
+    message(STATUS "Using Parallel Policies")
     if (PARALLELSTL_BACKEND STREQUAL "tbb")
         find_package(TBB 2018 REQUIRED tbb OPTIONAL_COMPONENTS tbbmalloc)
         message(STATUS "Parallel STL uses TBB ${TBB_VERSION} (interface version: ${TBB_INTERFACE_VERSION})")
         target_link_libraries(ParallelSTL INTERFACE TBB::tbb)
-    else()
+      else()
+        message(STATUS "Using Parallel Policies, but not tbb")
         if (TARGET ${PARALLELSTL_BACKEND})
             target_link_libraries(ParallelSTL INTERFACE ${PARALLELSTL_BACKEND})
         else()
diff --git a/include/pstl/internal/parallel_backend_utils.h b/include/pstl/internal/parallel_backend_utils.h
index dd9cabc..1d4f14b 100644
--- a/include/pstl/internal/parallel_backend_utils.h
+++ b/include/pstl/internal/parallel_backend_utils.h
@@ -12,6 +12,7 @@
 
 #include <iterator>
 #include <utility>
+#include <cassert>
 #include "utils.h"
 
 namespace __pstl
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 1b8638a..3381497 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -18,14 +18,17 @@
     DEPENDS pstl-build-tests
     COMMENT "Build and run all the unit tests.")
 
-file(GLOB_RECURSE UNIT_TESTS "test_*.cpp")
+file(GLOB_RECURSE UNIT_TESTS "*.pass.cpp")
 foreach(_file IN LISTS UNIT_TESTS)
     file(RELATIVE_PATH _target "${CMAKE_CURRENT_SOURCE_DIR}" "${_file}")
     string(REPLACE ".cpp" "" _target "${_target}")
+    string(REPLACE "/" "-" _target "${_target}")
     set(_target "pstl-${_target}")
 
     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)
     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/test/test_inplace_merge.cpp b/test/std/algorithms/alg.merge/inplace_merge.pass.cpp
similarity index 95%
rename from test/test_inplace_merge.cpp
rename to test/std/algorithms/alg.merge/inplace_merge.pass.cpp
index 8bf79f5..6e89ab8 100644
--- a/test/test_inplace_merge.cpp
+++ b/test/std/algorithms/alg.merge/inplace_merge.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_inplace_merge.cpp --------------------------------------------===//
+//===-- inplace_merge.pass.cpp --------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,13 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include <algorithm>
 #include "pstl/execution"
 #include "pstl/algorithm"
 
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_merge.cpp b/test/std/algorithms/alg.merge/merge.pass.cpp
similarity index 94%
rename from test/test_merge.cpp
rename to test/std/algorithms/alg.merge/merge.pass.cpp
index 6b2ed4b..a80bbae 100644
--- a/test/test_merge.cpp
+++ b/test/std/algorithms/alg.merge/merge.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_merge.cpp ----------------------------------------------------===//
+//===-- merge.pass.cpp ----------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,14 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include <algorithm>
 #include <functional>
 #include "pstl/execution"
 #include "pstl/algorithm"
 
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_copy_if.cpp b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp
similarity index 95%
rename from test/test_copy_if.cpp
rename to test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp
index dba6f23..5e6ea34 100644
--- a/test/test_copy_if.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_copy_if.cpp --------------------------------------------------===//
+//===-- copy_if.pass.cpp --------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -8,11 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // Tests for copy_if and remove_copy_if
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_is_partitioned.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
similarity index 91%
rename from test/test_is_partitioned.cpp
rename to test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
index a80a331..5d665d2 100644
--- a/test/test_is_partitioned.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_is_partitioned.cpp -------------------------------------------===//
+//===-- is_partitioned.pass.cpp -------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_partition.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
similarity index 95%
rename from test/test_partition.cpp
rename to test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
index ad5d992..b79a27a 100644
--- a/test/test_partition.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_partition.cpp ------------------------------------------------===//
+//===-- partition.pass.cpp ------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -8,11 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // Tests for stable_partition and partition
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 #include <iterator>
 #include <type_traits>
diff --git a/test/test_partition_copy.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
similarity index 94%
rename from test/test_partition_copy.cpp
rename to test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
index 1635406..c27e51c 100644
--- a/test/test_partition_copy.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_partition_copy.cpp -------------------------------------------===//
+//===-- partition_copy.pass.cpp -------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -8,11 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // Tests for stable_partition and partition_copy
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 #include <cstdlib>
 #include <iterator>
diff --git a/test/test_reverse.cpp b/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp
similarity index 92%
rename from test/test_reverse.cpp
rename to test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp
index 4842030..ad722df 100644
--- a/test/test_reverse.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_reverse.cpp --------------------------------------------------===//
+//===-- reverse.pass.cpp --------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,13 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include <iterator>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_reverse_copy.cpp b/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp
similarity index 93%
rename from test/test_reverse_copy.cpp
rename to test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp
index 1378a95..d26f41f 100644
--- a/test/test_reverse_copy.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_reverse_copy.cpp ---------------------------------------------===//
+//===-- reverse_copy.pass.cpp ---------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,13 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include <iterator>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_copy_move.cpp b/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp
similarity index 96%
rename from test/test_copy_move.cpp
rename to test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp
index 7fdf549..89de3f9 100644
--- a/test/test_copy_move.cpp
+++ b/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_copy_move.cpp ------------------------------------------------===//
+//===-- copy_move.pass.cpp ------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -9,11 +9,17 @@
 
 // Tests for copy, move and copy_n
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_fill.cpp b/test/std/algorithms/alg.modifying.operations/fill.pass.cpp
similarity index 90%
rename from test/test_fill.cpp
rename to test/std/algorithms/alg.modifying.operations/fill.pass.cpp
index 64f411b..19bc150 100644
--- a/test/test_fill.cpp
+++ b/test/std/algorithms/alg.modifying.operations/fill.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_fill.cpp -----------------------------------------------------===//
+//===-- fill.pass.cpp -----------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for fill/fill_n
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_generate.cpp b/test/std/algorithms/alg.modifying.operations/generate.pass.cpp
similarity index 90%
rename from test/test_generate.cpp
rename to test/std/algorithms/alg.modifying.operations/generate.pass.cpp
index 4a88ee9..9862f14 100644
--- a/test/test_generate.cpp
+++ b/test/std/algorithms/alg.modifying.operations/generate.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_generate.cpp -------------------------------------------------===//
+//===-- generate.pass.cpp -------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,12 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for generate
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 #include <atomic>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_remove.cpp b/test/std/algorithms/alg.modifying.operations/remove.pass.cpp
similarity index 95%
rename from test/test_remove.cpp
rename to test/std/algorithms/alg.modifying.operations/remove.pass.cpp
index ee08df1..82b986b 100644
--- a/test/test_remove.cpp
+++ b/test/std/algorithms/alg.modifying.operations/remove.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_remove.cpp ---------------------------------------------------===//
+//===-- remove.pass.cpp ---------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -8,11 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // Test for remove, remove_if
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_remove_copy.cpp b/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp
similarity index 92%
rename from test/test_remove_copy.cpp
rename to test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp
index 2d62c1a..0437292 100644
--- a/test/test_remove_copy.cpp
+++ b/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_remove_copy.cpp ----------------------------------------------===//
+//===-- remove_copy.pass.cpp ----------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for remove_copy
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_replace.cpp b/test/std/algorithms/alg.modifying.operations/replace.pass.cpp
similarity index 94%
rename from test/test_replace.cpp
rename to test/std/algorithms/alg.modifying.operations/replace.pass.cpp
index 293de5a..5aeaac8 100644
--- a/test/test_replace.cpp
+++ b/test/std/algorithms/alg.modifying.operations/replace.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_replace.cpp --------------------------------------------------===//
+//===-- replace.pass.cpp --------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_replace_copy.cpp b/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp
similarity index 93%
rename from test/test_replace_copy.cpp
rename to test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp
index 1c89422..7ebbf4c 100644
--- a/test/test_replace_copy.cpp
+++ b/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_replace_copy.cpp ---------------------------------------------===//
+//===-- replace_copy.pass.cpp ---------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -9,11 +9,17 @@
 
 // Tests for replace_copy and replace_copy_if
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_rotate.cpp b/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp
similarity index 94%
rename from test/test_rotate.cpp
rename to test/std/algorithms/alg.modifying.operations/rotate.pass.cpp
index 5619bca..2bebc4e 100644
--- a/test/test_rotate.cpp
+++ b/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_rotate.cpp ---------------------------------------------------===//
+//===-- rotate.pass.cpp ---------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,13 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include <iterator>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_rotate_copy.cpp b/test/std/algorithms/alg.modifying.operations/rotate_copy.pass.cpp
similarity index 93%
rename from test/test_rotate_copy.cpp
rename to test/std/algorithms/alg.modifying.operations/rotate_copy.pass.cpp
index aa800d2..7d0ec7e 100644
--- a/test/test_rotate_copy.cpp
+++ b/test/std/algorithms/alg.modifying.operations/rotate_copy.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_rotate_copy.cpp ----------------------------------------------===//
+//===-- rotate_copy.pass.cpp ----------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,13 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include <iterator>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_swap_ranges.cpp b/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp
similarity index 92%
rename from test/test_swap_ranges.cpp
rename to test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp
index 5be0614..b53003c 100644
--- a/test/test_swap_ranges.cpp
+++ b/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_swap_ranges.cpp ----------------------------------------------===//
+//===-- swap_ranges.pass.cpp ----------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,13 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include <iterator>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_transform_binary.cpp b/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp
similarity index 93%
rename from test/test_transform_binary.cpp
rename to test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp
index 4f5f4d2..2d680c3 100644
--- a/test/test_transform_binary.cpp
+++ b/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_transform_binary.cpp -----------------------------------------===//
+//===-- transform_binary.pass.cpp -----------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,9 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl/execution"
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/algorithm"
-#include "utils.h"
+#include "pstl/execution"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_transform_unary.cpp b/test/std/algorithms/alg.modifying.operations/transform_unary.pass.cpp
similarity index 90%
rename from test/test_transform_unary.cpp
rename to test/std/algorithms/alg.modifying.operations/transform_unary.pass.cpp
index 0389aa6..e198c6e 100644
--- a/test/test_transform_unary.cpp
+++ b/test/std/algorithms/alg.modifying.operations/transform_unary.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_transform_unary.cpp ------------------------------------------===//
+//===-- transform_unary.pass.cpp ------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,9 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl/execution"
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/algorithm"
-#include "utils.h"
+#include "pstl/execution"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_unique.cpp b/test/std/algorithms/alg.modifying.operations/unique.pass.cpp
similarity index 94%
rename from test/test_unique.cpp
rename to test/std/algorithms/alg.modifying.operations/unique.pass.cpp
index ee34ebd..06639cc 100644
--- a/test/test_unique.cpp
+++ b/test/std/algorithms/alg.modifying.operations/unique.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_unique.cpp ---------------------------------------------------===//
+//===-- unique.pass.cpp ---------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -8,11 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // Test for unique
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_unique_copy_equal.cpp b/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp
similarity index 94%
rename from test/test_unique_copy_equal.cpp
rename to test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp
index 392f8db..c948e80 100644
--- a/test/test_unique_copy_equal.cpp
+++ b/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_unique_copy_equal.cpp ----------------------------------------===//
+//===-- unique_copy_equal.pass.cpp ----------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -8,11 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // Tests for unique_copy
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_adjacent_find.cpp b/test/std/algorithms/alg.nonmodifying/adjacent_find.pass.cpp
similarity index 93%
rename from test/test_adjacent_find.cpp
rename to test/std/algorithms/alg.nonmodifying/adjacent_find.pass.cpp
index 3944014..50b01e3 100644
--- a/test/test_adjacent_find.cpp
+++ b/test/std/algorithms/alg.nonmodifying/adjacent_find.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_adjacent_find.cpp --------------------------------------------===//
+//===-- adjacent_find.pass.cpp --------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for adjacent_find
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_all_of.cpp b/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp
similarity index 92%
rename from test/test_all_of.cpp
rename to test/std/algorithms/alg.nonmodifying/all_of.pass.cpp
index 1de6e03..f6372c4 100644
--- a/test/test_all_of.cpp
+++ b/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_all_of.cpp ---------------------------------------------------===//
+//===-- all_of.pass.cpp ---------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 /*
   TODO: consider implementing the following tests for a better code coverage
diff --git a/test/test_any_of.cpp b/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp
similarity index 91%
rename from test/test_any_of.cpp
rename to test/std/algorithms/alg.nonmodifying/any_of.pass.cpp
index 0509078..70bd4b2 100644
--- a/test/test_any_of.cpp
+++ b/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_any_of.cpp ---------------------------------------------------===//
+//===-- any_of.pass.cpp ---------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 /*
   TODO: consider implementing the following tests for a better code coverage
diff --git a/test/test_count.cpp b/test/std/algorithms/alg.nonmodifying/count.pass.cpp
similarity index 92%
rename from test/test_count.cpp
rename to test/std/algorithms/alg.nonmodifying/count.pass.cpp
index c6a7d21..38c5537 100644
--- a/test/test_count.cpp
+++ b/test/std/algorithms/alg.nonmodifying/count.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_count.cpp ----------------------------------------------------===//
+//===-- count.pass.cpp ----------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -8,11 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // Tests for count and count_if
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_equal.cpp b/test/std/algorithms/alg.nonmodifying/equal.pass.cpp
similarity index 93%
rename from test/test_equal.cpp
rename to test/std/algorithms/alg.nonmodifying/equal.pass.cpp
index 5cb52ba..0e4f38c 100644
--- a/test/test_equal.cpp
+++ b/test/std/algorithms/alg.nonmodifying/equal.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_equal.cpp ----------------------------------------------------===//
+//===-- equal.pass.cpp ----------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_find.cpp b/test/std/algorithms/alg.nonmodifying/find.pass.cpp
similarity index 92%
rename from test/test_find.cpp
rename to test/std/algorithms/alg.nonmodifying/find.pass.cpp
index 956b099..60e56ae 100644
--- a/test/test_find.cpp
+++ b/test/std/algorithms/alg.nonmodifying/find.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_find.cpp -----------------------------------------------------===//
+//===-- find.pass.cpp -----------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -8,11 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // Tests for find
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_find_end.cpp b/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp
similarity index 93%
rename from test/test_find_end.cpp
rename to test/std/algorithms/alg.nonmodifying/find_end.pass.cpp
index 0a5a44b..4059630 100644
--- a/test/test_find_end.cpp
+++ b/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_find_end.cpp -------------------------------------------------===//
+//===-- find_end.pass.cpp -------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_find_first_of.cpp b/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp
similarity index 93%
rename from test/test_find_first_of.cpp
rename to test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp
index 8cdb308..ee62e84 100644
--- a/test/test_find_first_of.cpp
+++ b/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_find_first_of.cpp --------------------------------------------===//
+//===-- find_first_of.pass.cpp --------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_find_if.cpp b/test/std/algorithms/alg.nonmodifying/find_if.pass.cpp
similarity index 93%
rename from test/test_find_if.cpp
rename to test/std/algorithms/alg.nonmodifying/find_if.pass.cpp
index 914ebc2..2ea8765 100644
--- a/test/test_find_if.cpp
+++ b/test/std/algorithms/alg.nonmodifying/find_if.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_find_if.cpp --------------------------------------------------===//
+//===-- find_if.pass.cpp --------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -8,11 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // Tests for find_if and find_if_not
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_for_each.cpp b/test/std/algorithms/alg.nonmodifying/for_each.pass.cpp
similarity index 90%
rename from test/test_for_each.cpp
rename to test/std/algorithms/alg.nonmodifying/for_each.pass.cpp
index 0d89cc2..cb0fa06 100644
--- a/test/test_for_each.cpp
+++ b/test/std/algorithms/alg.nonmodifying/for_each.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_for_each.cpp -------------------------------------------------===//
+//===-- for_each.pass.cpp -------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,9 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_mismatch.cpp b/test/std/algorithms/alg.nonmodifying/mismatch.pass.cpp
similarity index 94%
rename from test/test_mismatch.cpp
rename to test/std/algorithms/alg.nonmodifying/mismatch.pass.cpp
index 5d5c9e8..ec34af0 100644
--- a/test/test_mismatch.cpp
+++ b/test/std/algorithms/alg.nonmodifying/mismatch.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_mismatch.cpp -------------------------------------------------===//
+//===-- mismatch.pass.cpp -------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,14 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for the rest algorithms; temporary approach to check compiling
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include "pstl/execution"
 #include "pstl/algorithm"
 #include "pstl/numeric"
 #include "pstl/memory"
 
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_none_of.cpp b/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp
similarity index 91%
rename from test/test_none_of.cpp
rename to test/std/algorithms/alg.nonmodifying/none_of.pass.cpp
index 43f0da6..47a01a1 100644
--- a/test/test_none_of.cpp
+++ b/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_none_of.cpp --------------------------------------------------===//
+//===-- none_of.pass.cpp --------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 /*
   TODO: consider implementing the following tests for a better code coverage
diff --git a/test/test_nth_element.cpp b/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp
similarity index 95%
rename from test/test_nth_element.cpp
rename to test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp
index eb7b726..f8154d2 100644
--- a/test/test_nth_element.cpp
+++ b/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_nth_element.cpp ----------------------------------------------===//
+//===-- nth_element.pass.cpp ----------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,14 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include <algorithm>
 #include <iostream>
 #include "pstl/execution"
 #include "pstl/algorithm"
 
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_search_n.cpp b/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp
similarity index 92%
rename from test/test_search_n.cpp
rename to test/std/algorithms/alg.nonmodifying/search_n.pass.cpp
index 1603367..c0c6040 100644
--- a/test/test_search_n.cpp
+++ b/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_search_n.cpp -------------------------------------------------===//
+//===-- search_n.pass.cpp -------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_is_heap.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp
similarity index 94%
rename from test/test_is_heap.cpp
rename to test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp
index dacdd87..0c70342 100644
--- a/test/test_is_heap.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_is_heap.cpp --------------------------------------------------===//
+//===-- is_heap.pass.cpp --------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -8,11 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // Tests for is_heap, is_heap_until
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 #include <iostream>
 
 using namespace TestUtils;
diff --git a/test/test_lexicographical_compare.cpp b/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp
similarity index 95%
rename from test/test_lexicographical_compare.cpp
rename to test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp
index 3a98808..236e342 100644
--- a/test/test_lexicographical_compare.cpp
+++ b/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_lexicographical_compare.cpp ----------------------------------===//
+//===-- lexicographical_compare.pass.cpp ----------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,13 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
-#include <string>
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 #include <iostream>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_minmax_element.cpp b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
similarity index 95%
rename from test/test_minmax_element.cpp
rename to test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
index 8b7cb51..e3fec86 100644
--- a/test/test_minmax_element.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_minmax_element.cpp -------------------------------------------===//
+//===-- minmax_element.pass.cpp -------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for min_element, max_element, minmax_element
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 #include <set>
 #include <cassert>
diff --git a/test/test_includes.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp
similarity index 92%
rename from test/test_includes.cpp
rename to test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp
index 5a2b51e..b18bb5f 100644
--- a/test/test_includes.cpp
+++ b/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_includes.cpp -------------------------------------------------===//
+//===-- includes.pass.cpp -------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,13 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for partial_sort
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include <cmath>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_set.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp
similarity index 95%
rename from test/test_set.cpp
rename to test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp
index 0e59ef2..33b7542 100644
--- a/test/test_set.cpp
+++ b/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_set.cpp ------------------------------------------------------===//
+//===-- set.pass.cpp ------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,14 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for partial_sort
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include <cmath>
 #include <chrono>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_is_sorted.cpp b/test/std/algorithms/alg.sorting/is_sorted.pass.cpp
similarity index 92%
rename from test/test_is_sorted.cpp
rename to test/std/algorithms/alg.sorting/is_sorted.pass.cpp
index a269458..a5219f7 100644
--- a/test/test_is_sorted.cpp
+++ b/test/std/algorithms/alg.sorting/is_sorted.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_is_sorted.cpp ------------------------------------------------===//
+//===-- is_sorted.pass.cpp ------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for is_sorted, is_sorted_until
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_partial_sort.cpp b/test/std/algorithms/alg.sorting/partial_sort.pass.cpp
similarity index 93%
rename from test/test_partial_sort.cpp
rename to test/std/algorithms/alg.sorting/partial_sort.pass.cpp
index 1c28b09..6e9d7d2 100644
--- a/test/test_partial_sort.cpp
+++ b/test/std/algorithms/alg.sorting/partial_sort.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_partial_sort.cpp ---------------------------------------------===//
+//===-- partial_sort.pass.cpp ---------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,13 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for partial_sort
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include <cmath>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_partial_sort_copy.cpp b/test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp
similarity index 95%
rename from test/test_partial_sort_copy.cpp
rename to test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp
index 11d4721..8f13202 100644
--- a/test/test_partial_sort_copy.cpp
+++ b/test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_partial_sort_copy.cpp ----------------------------------------===//
+//===-- partial_sort_copy.pass.cpp ----------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -10,11 +10,17 @@
 // Tests for partial_sort_copy
 
 #include <cmath>
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_sort.cpp b/test/std/algorithms/alg.sorting/sort.pass.cpp
similarity index 96%
rename from test/test_sort.cpp
rename to test/std/algorithms/alg.sorting/sort.pass.cpp
index 17cae92..e2eb9ce 100644
--- a/test/test_sort.cpp
+++ b/test/std/algorithms/alg.sorting/sort.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_sort.cpp -----------------------------------------------------===//
+//===-- sort.pass.cpp -----------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for sort and stable_sort
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include "pstl/execution"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 #define _CRT_SECURE_NO_WARNINGS
diff --git a/test/test_adjacent_difference.cpp b/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp
similarity index 95%
rename from test/test_adjacent_difference.cpp
rename to test/std/numerics/numeric.ops/adjacent_difference.pass.cpp
index e95f9d1..8380991 100644
--- a/test/test_adjacent_difference.cpp
+++ b/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_adjacent_difference.cpp --------------------------------------===//
+//===-- adjacent_difference.pass.cpp --------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,14 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include <iterator>
 
 #include "pstl/execution"
 #include "pstl/algorithm"
 #include "pstl/numeric"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_reduce.cpp b/test/std/numerics/numeric.ops/reduce.pass.cpp
similarity index 93%
rename from test/test_reduce.cpp
rename to test/std/numerics/numeric.ops/reduce.pass.cpp
index ad8872a..cd851aa 100644
--- a/test/test_reduce.cpp
+++ b/test/std/numerics/numeric.ops/reduce.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_reduce.cpp ---------------------------------------------------===//
+//===-- reduce.pass.cpp ---------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/numeric"
-#include "utils.h"
+#else
+#include <execution>
+#include <numeric>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_scan.cpp b/test/std/numerics/numeric.ops/scan.pass.cpp
similarity index 96%
rename from test/test_scan.cpp
rename to test/std/numerics/numeric.ops/scan.pass.cpp
index 9193d93..e7283ee 100644
--- a/test/test_scan.cpp
+++ b/test/std/numerics/numeric.ops/scan.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_scan.cpp -----------------------------------------------------===//
+//===-- scan.pass.cpp -----------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,10 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/numeric"
-#include "utils.h"
-#include "pstl_test_config.h"
+#else
+#include <execution>
+#include <numeric>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_transform_reduce.cpp b/test/std/numerics/numeric.ops/transform_reduce.pass.cpp
similarity index 94%
rename from test/test_transform_reduce.cpp
rename to test/std/numerics/numeric.ops/transform_reduce.pass.cpp
index a1ec7a3..792190a 100644
--- a/test/test_transform_reduce.cpp
+++ b/test/std/numerics/numeric.ops/transform_reduce.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_transform_reduce.cpp -----------------------------------------===//
+//===-- transform_reduce.pass.cpp -----------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,11 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for inner_product
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include "pstl/execution"
 #include "pstl/numeric"
-#include "utils.h"
+#else
+#include <execution>
+#include <numeric>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_transform_scan.cpp b/test/std/numerics/numeric.ops/transform_scan.pass.cpp
similarity index 96%
rename from test/test_transform_scan.cpp
rename to test/std/numerics/numeric.ops/transform_scan.pass.cpp
index 0014437..4934f7e 100644
--- a/test/test_transform_scan.cpp
+++ b/test/std/numerics/numeric.ops/transform_scan.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_transform_scan.cpp -------------------------------------------===//
+//===-- transform_scan.pass.cpp -------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,10 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/numeric"
-#include "utils.h"
-#include "pstl_test_config.h"
+#else
+#include <execution>
+#include <numeric>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_uninitialized_construct.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized_construct.pass.cpp
similarity index 93%
rename from test/test_uninitialized_construct.cpp
rename to test/std/utilities/memory/specialized.algorithms/uninitialized_construct.pass.cpp
index 88873a3..ee5f309 100644
--- a/test/test_uninitialized_construct.cpp
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized_construct.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_uninitialized_construct.cpp ----------------------------------===//
+//===-- uninitialized_construct.pass.cpp ----------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -10,11 +10,17 @@
 // Tests for uninitialized_default_construct, uninitialized_default_construct_n,
 //           uninitialized_value_construct,   uninitialized_value_construct_n
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/memory"
-#include "utils.h"
+#else
+#include <execution>
+#include <memory>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_uninitialized_copy_move.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp
similarity index 94%
rename from test/test_uninitialized_copy_move.cpp
rename to test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp
index 4306511..f983777 100644
--- a/test/test_uninitialized_copy_move.cpp
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_uninitialized_copy_move.cpp ----------------------------------===//
+//===-- uninitialized_copy_move.pass.cpp ----------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -9,11 +9,17 @@
 
 // Tests for uninitialized_copy, uninitialized_copy_n, uninitialized_move, uninitialized_move_n
 
-#include "pstl_test_config.h"
+#include "support/pstl_test_config.h"
 
+#ifdef PSTL_STANDALONE_TESTS
 #include "pstl/execution"
 #include "pstl/memory"
-#include "utils.h"
+#else
+#include <execution>
+#include <memory>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/test_uninitialized_fill_destroy.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized_fill_destroy.pass.cpp
similarity index 92%
rename from test/test_uninitialized_fill_destroy.cpp
rename to test/std/utilities/memory/specialized.algorithms/uninitialized_fill_destroy.pass.cpp
index d1cfa10..12301f0 100644
--- a/test/test_uninitialized_fill_destroy.cpp
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized_fill_destroy.pass.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-- test_uninitialized_fill_destroy.cpp -------------------------------===//
+//===-- uninitialized_fill_destroy.pass.cpp -------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,12 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Tests for the destroy, destroy_n, uninitialized_fill, uninitialized_fill_n algorithms
+#include "support/pstl_test_config.h"
+
+#ifdef PSTL_STANDALONE_TESTS
 
 #include "pstl/execution"
 #include "pstl/memory"
 #include "pstl/algorithm"
-#include "utils.h"
+#else
+#include <execution>
+#include <algorithm>
+#endif // PSTL_STANDALONE_TESTS
+
+#include "support/utils.h"
 
 using namespace TestUtils;
 
diff --git a/test/pstl_test_config.h b/test/support/pstl_test_config.h
similarity index 100%
rename from test/pstl_test_config.h
rename to test/support/pstl_test_config.h
diff --git a/test/utils.h b/test/support/utils.h
similarity index 100%
rename from test/utils.h
rename to test/support/utils.h