@@ -267,3 +267,48 @@ TEST(ParseAllowListTests, CheckExceptionIsThrownForValueWOColonDelim) {
267267 FAIL () << " Expected sycl::runtime_error" ;
268268 }
269269}
270+
271+ TEST (ParseAllowListTests, CheckDeviceNameDeprecationWarning) {
272+ testing::internal::CaptureStdout ();
273+ sycl::detail::parseAllowList (" DeviceName:{{regex}}" );
274+ std::string ActualOutput = testing::internal::GetCapturedStdout ();
275+ EXPECT_EQ (" \n WARNING: DeviceName in SYCL_DEVICE_ALLOWLIST is deprecated. "
276+ " Please use BackendName, DeviceType and DeviceVendorId instead. "
277+ " For details, please refer to "
278+ " https://github.com/intel/llvm/blob/sycl/sycl/doc/"
279+ " EnvironmentVariables.md\n\n " ,
280+ ActualOutput);
281+ }
282+
283+ TEST (ParseAllowListTests, CheckPlatformNameDeprecationWarning) {
284+ testing::internal::CaptureStdout ();
285+ sycl::detail::parseAllowList (" PlatformName:{{regex}}" );
286+ std::string ActualOutput = testing::internal::GetCapturedStdout ();
287+ EXPECT_EQ (" \n WARNING: PlatformName in SYCL_DEVICE_ALLOWLIST is deprecated. "
288+ " Please use BackendName, DeviceType and DeviceVendorId instead. "
289+ " For details, please refer to "
290+ " https://github.com/intel/llvm/blob/sycl/sycl/doc/"
291+ " EnvironmentVariables.md\n\n " ,
292+ ActualOutput);
293+ }
294+
295+ TEST (ParseAllowListTests, CheckDeviceNameAndPlatformNameDeprecationWarning) {
296+ testing::internal::CaptureStdout ();
297+ sycl::detail::parseAllowList (" DeviceName:{{regex}},PlatformName:{{regex}}" );
298+ std::string ActualOutput = testing::internal::GetCapturedStdout ();
299+ EXPECT_EQ (" \n WARNING: DeviceName and PlatformName in SYCL_DEVICE_ALLOWLIST "
300+ " are deprecated. Please use BackendName, DeviceType and "
301+ " DeviceVendorId instead. For details, please refer to "
302+ " https://github.com/intel/llvm/blob/sycl/sycl/doc/"
303+ " EnvironmentVariables.md\n\n " ,
304+ ActualOutput);
305+ }
306+
307+ TEST (ParseAllowListTests, CheckNoDeprecationWarningForNotDeprecatedKeys) {
308+ testing::internal::CaptureStdout ();
309+ sycl::detail::parseAllowList (
310+ " BackendName:level_zero,DeviceType:gpu,DeviceVendorId:0x0000,"
311+ " DriverVersion:{{regex1}},PlatformVersion:{{regex2}}" );
312+ std::string ActualOutput = testing::internal::GetCapturedStdout ();
313+ EXPECT_EQ (" " , ActualOutput);
314+ }
0 commit comments