@@ -54,6 +54,63 @@ see [ABI Policy Guide](sycl/doc/ABIPolicyGuide.md) for more information.
5454- Run regression tests -
5555[instructions](sycl/doc/GetStartedGuide.md#test-dpc-toolchain).
5656
57+ # ## Tests development
58+
59+ Every product change should be accompanied with corresponding test modification
60+ (adding new test(s), extending, removing or modifying existing test(s)).
61+
62+ There are 3 types of tests which are used for DPC++ toolchain validation:
63+ * DPC++ in-tree LIT tests including [check-llvm](../../llvm/test),
64+ [check-clang](../../clang/test), [check-llvm-spirv](../../llvm-spirv/test) and
65+ [check-sycl](../../sycl/test) targets stored in this repository. These tests
66+ should not have hardware (e.g. GPU, FPGA, etc.) or external software
67+ dependencies (e.g. OpenCL, Level Zero, CUDA runtimes). All tests not following
68+ this approach should be moved to DPC++ end-to-end or SYCL-CTS tests.
69+ However, the tests for a feature under active development requiring atomic
70+ change for tests and product can be put to
71+ [sycl/test/on-device](../../sycl/test/on-device) temporarily. It is developer
72+ responsibility to move the tests to DPC++ E2E test suite or SYCL-CTS once
73+ the feature is stabilized.
74+
75+ ** Guidelines for adding DPC++ in-tree LIT tests (DPC++ Clang FE tests)** :
76+ - Use ` sycl::` namespace instead of ` cl::sycl::`
77+
78+ - Include sycl mock headers as system headers.
79+ Example: ` -internal-isystem %S/Inputs`
80+ ` # include "sycl.hpp"`
81+
82+ - Use SYCL functions for invoking kernels from the mock header ` (single_task, parallel_for, parallel_for_work_group)`
83+ Example:
84+ ` ` ` bash
85+ ` # include "Inputs/sycl.hpp"`
86+ sycl::queue q;
87+ q.submit([& ](cl::sycl::handler & h) {
88+ h.single_task( { //code });
89+ });
90+ ` ` `
91+
92+ - Add a helpful comment describing what the test does at the beginning and other comments throughout the test as necessary.
93+
94+ - Try to follow descriptive naming convention for variables, functions as much as possible.
95+ Please refer [LLVM naming convention](https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly)
96+
97+ * DPC++ end-to-end (E2E) tests which are extension to
98+ [LLVM\* test suite](https://github.com/intel/llvm-test-suite/tree/intel/SYCL).
99+ A test which requires full stack including backend runtimes (e.g. OpenCL,
100+ Level Zero or CUDA) should be put to DPC++ E2E test suite following
101+ [CONTRIBUTING](https://github.com/intel/llvm-test-suite/blob/intel/CONTRIBUTING.md).
102+
103+ * SYCL-CTS are official
104+ [Khronos\* SYCL\* conformance tests](https://github.com/KhronosGroup/SYCL-CTS).
105+ They verify SYCL specification compatibility. All implementation details or
106+ extensions are out of scope for the tests. If SYCL specification has changed
107+ (SYCL CTS tests conflict with recent version of SYCL specification) or change
108+ is required in the way the tests are built with DPC++ compiler (defined in
109+ [FindIntel_SYCL](https://github.com/KhronosGroup/SYCL-CTS/blob/SYCL-1.2.1/master/cmake/FindIntel_SYCL.cmake))
110+ pull request should be created under
111+ [KhronosGroup/SYCL-CTS](https://github.com/KhronosGroup/SYCL-CTS) with required
112+ patch.
113+
57114# ## Commit message
58115
59116- When writing your commit message, please make sure to follow
@@ -62,6 +119,14 @@ see [ABI Policy Guide](sycl/doc/ABIPolicyGuide.md) for more information.
62119- For any DPC++-related commit, the ` [SYCL]` tag should be present in the
63120 commit message title. To a reasonable extent, additional tags can be used
64121 to signify the component changed, e.g.: ` [PI]` , ` [CUDA]` , ` [Doc]` .
122+ - For product changes which require modification in tests outside of the current repository
123+ (see [Test DPC++ toolchain](sycl/doc/GetStartedGuide.md#test-dpc-toolchain)),
124+ the commit message should contain the link to corresponding test PR, e.g.: E2E
125+ test changes are available under intel/llvm-test-suite#88 or SYCL
126+ conformance test changes are available under KhronosGroup/SYCL-CTS#65 (see
127+ [Autolinked references and URLs](https://docs.github.com/en/free-pro-team/github/writing-on-github/autolinked-references-and-urls)
128+ for more details). The same message should be present both in commit
129+ message and in PR description.
65130
66131# ## Review and acceptance testing
67132
0 commit comments