diff --git a/build_tools/cmake/iree_hal_cts_test_suite.cmake b/build_tools/cmake/iree_hal_cts_test_suite.cmake index 3671a4e78aab..ce229cbab1a4 100644 --- a/build_tools/cmake/iree_hal_cts_test_suite.cmake +++ b/build_tools/cmake/iree_hal_cts_test_suite.cmake @@ -181,7 +181,6 @@ function(iree_hal_cts_test_suite) set(IREE_CTS_TEST_FILE_PATH "runtime/src/iree/hal/cts/${_TEST_NAME}_test.h") set(IREE_CTS_DRIVER_REGISTRATION_HDR "${_RULE_DRIVER_REGISTRATION_HDR}") set(IREE_CTS_DRIVER_REGISTRATION_FN "${_RULE_DRIVER_REGISTRATION_FN}") - set(IREE_CTS_TEST_CLASS_NAME "${_TEST_NAME}_test") set(IREE_CTS_DRIVER_NAME "${_RULE_DRIVER_NAME}") set(IREE_CTS_TARGET_BACKEND "${_RULE_COMPILER_TARGET_BACKEND}") diff --git a/runtime/src/iree/hal/cts/allocator_test.h b/runtime/src/iree/hal/cts/allocator_test.h index 4ca450ed00b3..f8de4149047b 100644 --- a/runtime/src/iree/hal/cts/allocator_test.h +++ b/runtime/src/iree/hal/cts/allocator_test.h @@ -23,7 +23,7 @@ constexpr iree_device_size_t kAllocationSize = 1024; } // namespace -class allocator_test : public CtsTestBase {}; +class allocator_test : public CTSTestBase<> {}; // All allocators must support some baseline capabilities. // @@ -31,7 +31,7 @@ class allocator_test : public CtsTestBase {}; // driver implementations or target devices, such as: // IREE_HAL_MEMORY_TYPE_HOST_LOCAL | IREE_HAL_MEMORY_TYPE_DEVICE_LOCAL // IREE_HAL_BUFFER_USAGE_MAPPING -TEST_P(allocator_test, BaselineBufferCompatibility) { +TEST_F(allocator_test, BaselineBufferCompatibility) { // Need at least one way to get data between the host and device. iree_hal_buffer_params_t host_local_params = {0}; host_local_params.type = @@ -80,7 +80,7 @@ TEST_P(allocator_test, BaselineBufferCompatibility) { IREE_HAL_BUFFER_COMPATIBILITY_QUEUE_DISPATCH)); } -TEST_P(allocator_test, AllocateBuffer) { +TEST_F(allocator_test, AllocateBuffer) { iree_hal_buffer_params_t params = {0}; params.type = IREE_HAL_MEMORY_TYPE_DEVICE_LOCAL; params.usage = IREE_HAL_BUFFER_USAGE_TRANSFER; @@ -102,7 +102,7 @@ TEST_P(allocator_test, AllocateBuffer) { // While empty allocations aren't particularly useful, they can occur in // practice so we should at least be able to create them without errors. -TEST_P(allocator_test, AllocateEmptyBuffer) { +TEST_F(allocator_test, AllocateEmptyBuffer) { iree_hal_buffer_params_t params = {0}; params.type = IREE_HAL_MEMORY_TYPE_DEVICE_LOCAL; params.usage = IREE_HAL_BUFFER_USAGE_TRANSFER; diff --git a/runtime/src/iree/hal/cts/buffer_mapping_test.h b/runtime/src/iree/hal/cts/buffer_mapping_test.h index f56e3457de61..c97c1ac1031b 100644 --- a/runtime/src/iree/hal/cts/buffer_mapping_test.h +++ b/runtime/src/iree/hal/cts/buffer_mapping_test.h @@ -42,7 +42,7 @@ constexpr iree_device_size_t kDefaultAllocationSize = 1024; // * write with an offset and length // * write into a subspan of a buffer -class buffer_mapping_test : public CtsTestBase { +class buffer_mapping_test : public CTSTestBase<> { protected: void AllocateUninitializedBuffer(iree_device_size_t buffer_size, iree_hal_buffer_t** out_buffer) { @@ -59,7 +59,7 @@ class buffer_mapping_test : public CtsTestBase { } }; -TEST_P(buffer_mapping_test, AllocatorSupportsBufferMapping) { +TEST_F(buffer_mapping_test, AllocatorSupportsBufferMapping) { iree_hal_buffer_params_t params = {0}; params.type = IREE_HAL_MEMORY_TYPE_HOST_VISIBLE; params.usage = IREE_HAL_BUFFER_USAGE_MAPPING; @@ -83,7 +83,7 @@ TEST_P(buffer_mapping_test, AllocatorSupportsBufferMapping) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, ZeroWholeBuffer) { +TEST_F(buffer_mapping_test, ZeroWholeBuffer) { iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(kDefaultAllocationSize, &buffer); @@ -102,7 +102,7 @@ TEST_P(buffer_mapping_test, ZeroWholeBuffer) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, ZeroWithOffset) { +TEST_F(buffer_mapping_test, ZeroWithOffset) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); @@ -128,7 +128,7 @@ TEST_P(buffer_mapping_test, ZeroWithOffset) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, ZeroSubspan) { +TEST_F(buffer_mapping_test, ZeroSubspan) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); @@ -171,7 +171,7 @@ TEST_P(buffer_mapping_test, ZeroSubspan) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, FillEmpty) { +TEST_F(buffer_mapping_test, FillEmpty) { iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(kDefaultAllocationSize, &buffer); @@ -195,7 +195,7 @@ TEST_P(buffer_mapping_test, FillEmpty) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, FillWholeBuffer) { +TEST_F(buffer_mapping_test, FillWholeBuffer) { iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(kDefaultAllocationSize, &buffer); @@ -217,7 +217,7 @@ TEST_P(buffer_mapping_test, FillWholeBuffer) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, FillWithOffset) { +TEST_F(buffer_mapping_test, FillWithOffset) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); @@ -244,7 +244,7 @@ TEST_P(buffer_mapping_test, FillWithOffset) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, FillSubspan) { +TEST_F(buffer_mapping_test, FillSubspan) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); @@ -288,7 +288,7 @@ TEST_P(buffer_mapping_test, FillSubspan) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, ReadData) { +TEST_F(buffer_mapping_test, ReadData) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); @@ -325,7 +325,7 @@ TEST_P(buffer_mapping_test, ReadData) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, ReadDataSubspan) { +TEST_F(buffer_mapping_test, ReadDataSubspan) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); @@ -368,7 +368,7 @@ TEST_P(buffer_mapping_test, ReadDataSubspan) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, WriteDataWholeBuffer) { +TEST_F(buffer_mapping_test, WriteDataWholeBuffer) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); @@ -390,7 +390,7 @@ TEST_P(buffer_mapping_test, WriteDataWholeBuffer) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, WriteDataWithOffset) { +TEST_F(buffer_mapping_test, WriteDataWithOffset) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); @@ -417,7 +417,7 @@ TEST_P(buffer_mapping_test, WriteDataWithOffset) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, WriteDataSubspan) { +TEST_F(buffer_mapping_test, WriteDataSubspan) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); @@ -459,7 +459,7 @@ TEST_P(buffer_mapping_test, WriteDataSubspan) { iree_hal_buffer_release(buffer); } -TEST_P(buffer_mapping_test, CopyData) { +TEST_F(buffer_mapping_test, CopyData) { iree_hal_buffer_t* buffer_a = NULL; iree_hal_buffer_t* buffer_b = NULL; AllocateUninitializedBuffer(kDefaultAllocationSize, &buffer_a); @@ -490,7 +490,7 @@ TEST_P(buffer_mapping_test, CopyData) { // Maps a buffer range for reading from device -> host. // This is roughly what iree_hal_buffer_map_read does internally. -TEST_P(buffer_mapping_test, MapRangeRead) { +TEST_F(buffer_mapping_test, MapRangeRead) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); @@ -520,7 +520,7 @@ TEST_P(buffer_mapping_test, MapRangeRead) { // Maps a buffer range for writing from host -> device. // This is roughly what iree_hal_buffer_map_write does internally. -TEST_P(buffer_mapping_test, MapRangeWrite) { +TEST_F(buffer_mapping_test, MapRangeWrite) { iree_device_size_t buffer_size = 16; iree_hal_buffer_t* buffer = NULL; AllocateUninitializedBuffer(buffer_size, &buffer); diff --git a/runtime/src/iree/hal/cts/command_buffer_dispatch_test.h b/runtime/src/iree/hal/cts/command_buffer_dispatch_test.h index bea9b8ec6b4a..85f53f2d3347 100644 --- a/runtime/src/iree/hal/cts/command_buffer_dispatch_test.h +++ b/runtime/src/iree/hal/cts/command_buffer_dispatch_test.h @@ -18,7 +18,7 @@ namespace iree { namespace hal { namespace cts { -class command_buffer_dispatch_test : public CtsTestBase { +class command_buffer_dispatch_test : public CTSTestBase<> { protected: void PrepareAbsExecutable() { IREE_ASSERT_OK(iree_hal_executable_cache_create( @@ -76,7 +76,7 @@ class command_buffer_dispatch_test : public CtsTestBase { iree_hal_executable_t* executable_ = NULL; }; -TEST_P(command_buffer_dispatch_test, DispatchAbs) { +TEST_F(command_buffer_dispatch_test, DispatchAbs) { PrepareAbsExecutable(); iree_hal_command_buffer_t* command_buffer = NULL; diff --git a/runtime/src/iree/hal/cts/command_buffer_push_constants_test.h b/runtime/src/iree/hal/cts/command_buffer_push_constants_test.h index cfe436255097..aa719d2e25ea 100644 --- a/runtime/src/iree/hal/cts/command_buffer_push_constants_test.h +++ b/runtime/src/iree/hal/cts/command_buffer_push_constants_test.h @@ -20,7 +20,7 @@ namespace cts { using ::testing::ContainerEq; -class command_buffer_push_constants_test : public CtsTestBase { +class command_buffer_push_constants_test : public CTSTestBase<> { protected: void PrepareExecutable() { IREE_ASSERT_OK(iree_hal_executable_cache_create( @@ -77,7 +77,7 @@ class command_buffer_push_constants_test : public CtsTestBase { iree_hal_executable_t* executable_ = NULL; }; -TEST_P(command_buffer_push_constants_test, DispatchWithPushConstants) { +TEST_F(command_buffer_push_constants_test, DispatchWithPushConstants) { ASSERT_NO_FATAL_FAILURE(PrepareExecutable()); iree_hal_command_buffer_t* command_buffer = NULL; diff --git a/runtime/src/iree/hal/cts/command_buffer_test.h b/runtime/src/iree/hal/cts/command_buffer_test.h index 2c5c984aebac..dc23c9b77f30 100644 --- a/runtime/src/iree/hal/cts/command_buffer_test.h +++ b/runtime/src/iree/hal/cts/command_buffer_test.h @@ -26,7 +26,7 @@ namespace { constexpr iree_device_size_t kDefaultAllocationSize = 1024; } // namespace -class command_buffer_test : public CtsTestBase { +class command_buffer_test : public CTSTestBase<> { protected: void CreateZeroedDeviceBuffer(iree_device_size_t buffer_size, iree_hal_buffer_t** out_buffer) { @@ -83,7 +83,7 @@ class command_buffer_test : public CtsTestBase { } }; -TEST_P(command_buffer_test, Create) { +TEST_F(command_buffer_test, Create) { iree_hal_command_buffer_t* command_buffer = NULL; IREE_ASSERT_OK(iree_hal_command_buffer_create( device_, IREE_HAL_COMMAND_BUFFER_MODE_ONE_SHOT, @@ -97,7 +97,7 @@ TEST_P(command_buffer_test, Create) { iree_hal_command_buffer_release(command_buffer); } -TEST_P(command_buffer_test, BeginEnd) { +TEST_F(command_buffer_test, BeginEnd) { iree_hal_command_buffer_t* command_buffer = NULL; IREE_ASSERT_OK(iree_hal_command_buffer_create( device_, IREE_HAL_COMMAND_BUFFER_MODE_ONE_SHOT, @@ -110,7 +110,7 @@ TEST_P(command_buffer_test, BeginEnd) { iree_hal_command_buffer_release(command_buffer); } -TEST_P(command_buffer_test, SubmitEmpty) { +TEST_F(command_buffer_test, SubmitEmpty) { iree_hal_command_buffer_t* command_buffer = NULL; IREE_ASSERT_OK(iree_hal_command_buffer_create( device_, IREE_HAL_COMMAND_BUFFER_MODE_ONE_SHOT, @@ -125,7 +125,7 @@ TEST_P(command_buffer_test, SubmitEmpty) { iree_hal_command_buffer_release(command_buffer); } -TEST_P(command_buffer_test, CopyWholeBuffer) { +TEST_F(command_buffer_test, CopyWholeBuffer) { iree_hal_command_buffer_t* command_buffer = NULL; IREE_ASSERT_OK(iree_hal_command_buffer_create( device_, IREE_HAL_COMMAND_BUFFER_MODE_ONE_SHOT, @@ -188,7 +188,7 @@ TEST_P(command_buffer_test, CopyWholeBuffer) { iree_hal_buffer_release(host_buffer); } -TEST_P(command_buffer_test, CopySubBuffer) { +TEST_F(command_buffer_test, CopySubBuffer) { iree_hal_command_buffer_t* command_buffer = NULL; IREE_ASSERT_OK(iree_hal_command_buffer_create( device_, IREE_HAL_COMMAND_BUFFER_MODE_ONE_SHOT, @@ -272,7 +272,7 @@ TEST_P(command_buffer_test, CopySubBuffer) { iree_hal_buffer_release(host_buffer); } -TEST_P(command_buffer_test, FillBuffer_pattern1_size1_offset0_length1) { +TEST_F(command_buffer_test, FillBuffer_pattern1_size1_offset0_length1) { iree_device_size_t buffer_size = 1; iree_device_size_t target_offset = 0; iree_device_size_t fill_length = 1; @@ -284,7 +284,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern1_size1_offset0_length1) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern1_size5_offset0_length5) { +TEST_F(command_buffer_test, FillBuffer_pattern1_size5_offset0_length5) { iree_device_size_t buffer_size = 5; iree_device_size_t target_offset = 0; iree_device_size_t fill_length = 5; @@ -297,7 +297,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern1_size5_offset0_length5) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern1_size16_offset0_length1) { +TEST_F(command_buffer_test, FillBuffer_pattern1_size16_offset0_length1) { iree_device_size_t buffer_size = 16; iree_device_size_t target_offset = 0; iree_device_size_t fill_length = 1; @@ -312,7 +312,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern1_size16_offset0_length1) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern1_size16_offset0_length3) { +TEST_F(command_buffer_test, FillBuffer_pattern1_size16_offset0_length3) { iree_device_size_t buffer_size = 16; iree_device_size_t target_offset = 0; iree_device_size_t fill_length = 3; @@ -327,7 +327,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern1_size16_offset0_length3) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern1_size16_offset0_length8) { +TEST_F(command_buffer_test, FillBuffer_pattern1_size16_offset0_length8) { iree_device_size_t buffer_size = 16; iree_device_size_t target_offset = 0; iree_device_size_t fill_length = 8; @@ -342,7 +342,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern1_size16_offset0_length8) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern1_size16_offset2_length8) { +TEST_F(command_buffer_test, FillBuffer_pattern1_size16_offset2_length8) { iree_device_size_t buffer_size = 16; iree_device_size_t target_offset = 2; iree_device_size_t fill_length = 8; @@ -357,7 +357,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern1_size16_offset2_length8) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern2_size2_offset0_length2) { +TEST_F(command_buffer_test, FillBuffer_pattern2_size2_offset0_length2) { iree_device_size_t buffer_size = 2; iree_device_size_t target_offset = 0; iree_device_size_t fill_length = 2; @@ -369,7 +369,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern2_size2_offset0_length2) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern2_size16_offset0_length8) { +TEST_F(command_buffer_test, FillBuffer_pattern2_size16_offset0_length8) { iree_device_size_t buffer_size = 16; iree_device_size_t target_offset = 0; iree_device_size_t fill_length = 8; @@ -384,7 +384,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern2_size16_offset0_length8) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern2_size16_offset0_length10) { +TEST_F(command_buffer_test, FillBuffer_pattern2_size16_offset0_length10) { iree_device_size_t buffer_size = 16; iree_device_size_t target_offset = 0; iree_device_size_t fill_length = 10; @@ -399,7 +399,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern2_size16_offset0_length10) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern2_size16_offset2_length8) { +TEST_F(command_buffer_test, FillBuffer_pattern2_size16_offset2_length8) { iree_device_size_t buffer_size = 16; iree_device_size_t target_offset = 2; iree_device_size_t fill_length = 8; @@ -414,7 +414,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern2_size16_offset2_length8) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern4_size4_offset0_length4) { +TEST_F(command_buffer_test, FillBuffer_pattern4_size4_offset0_length4) { iree_device_size_t buffer_size = 4; iree_device_size_t target_offset = 0; iree_device_size_t fill_length = 4; @@ -426,7 +426,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern4_size4_offset0_length4) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern4_size4_offset16_length4) { +TEST_F(command_buffer_test, FillBuffer_pattern4_size4_offset16_length4) { iree_device_size_t buffer_size = 20; iree_device_size_t target_offset = 16; iree_device_size_t fill_length = 4; @@ -439,7 +439,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern4_size4_offset16_length4) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern4_size16_offset0_length8) { +TEST_F(command_buffer_test, FillBuffer_pattern4_size16_offset0_length8) { iree_device_size_t buffer_size = 16; iree_device_size_t target_offset = 0; iree_device_size_t fill_length = 8; @@ -454,7 +454,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern4_size16_offset0_length8) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, FillBuffer_pattern4_size16_offset8_length8) { +TEST_F(command_buffer_test, FillBuffer_pattern4_size16_offset8_length8) { iree_device_size_t buffer_size = 16; iree_device_size_t target_offset = 8; iree_device_size_t fill_length = 8; @@ -469,7 +469,7 @@ TEST_P(command_buffer_test, FillBuffer_pattern4_size16_offset8_length8) { EXPECT_THAT(actual_buffer, ContainerEq(reference_buffer)); } -TEST_P(command_buffer_test, UpdateBufferWholeBuffer) { +TEST_F(command_buffer_test, UpdateBufferWholeBuffer) { iree_device_size_t target_buffer_size = 16; std::vector source_buffer{0x01, 0x02, 0x03, 0x04, // 0x05, 0x06, 0x07, 0x08, // @@ -506,7 +506,7 @@ TEST_P(command_buffer_test, UpdateBufferWholeBuffer) { iree_hal_buffer_release(device_buffer); } -TEST_P(command_buffer_test, UpdateBufferWithOffsets) { +TEST_F(command_buffer_test, UpdateBufferWithOffsets) { iree_device_size_t target_buffer_size = 16; std::vector source_buffer{0x01, 0x02, 0x03, 0x04, // 0x05, 0x06, 0x07, 0x08, // @@ -548,7 +548,7 @@ TEST_P(command_buffer_test, UpdateBufferWithOffsets) { iree_hal_buffer_release(device_buffer); } -TEST_P(command_buffer_test, UpdateBufferSubspan) { +TEST_F(command_buffer_test, UpdateBufferSubspan) { iree_device_size_t target_buffer_size = 16; std::vector source_buffer{0x01, 0x02, 0x03, 0x04, // 0x05, 0x06, 0x07, 0x08, // diff --git a/runtime/src/iree/hal/cts/cts_test_base.h b/runtime/src/iree/hal/cts/cts_test_base.h index 1116eee5f4ab..bdef0285105e 100644 --- a/runtime/src/iree/hal/cts/cts_test_base.h +++ b/runtime/src/iree/hal/cts/cts_test_base.h @@ -20,7 +20,11 @@ namespace iree { namespace hal { namespace cts { -// Registers the driver that will be used with INSTANTIATE_TEST_SUITE_P. +// Returns the name of the driver under test. +// Leaf test binaries must implement this function. +const char* get_test_driver_name(); + +// Registers the driver referenced by get_test_driver_name. // Leaf test binaries must implement this function. iree_status_t register_test_driver(iree_hal_driver_registry_t* registry); @@ -33,7 +37,8 @@ const char* get_test_executable_format(); iree_const_byte_span_t get_test_executable_data(iree_string_view_t file_name); // Common setup for tests parameterized on driver names. -class CtsTestBase : public ::testing::TestWithParam { +template +class CTSTestBase : public BaseType { protected: static void SetUpTestSuite() { iree_status_t status = @@ -45,7 +50,7 @@ class CtsTestBase : public ::testing::TestWithParam { } virtual void SetUp() { - const std::string& driver_name = GetParam(); + const std::string& driver_name = get_test_driver_name(); // Get driver with the given name and create its default device. // Skip drivers that are (gracefully) unavailable, fail if creation fails. @@ -187,16 +192,6 @@ class CtsTestBase : public ::testing::TestWithParam { } }; -struct GenerateTestName { - template - std::string operator()( - const ::testing::TestParamInfo& info) const { - std::string name = info.param; - std::replace(name.begin(), name.end(), '-', '_'); - return name; - } -}; - } // namespace cts } // namespace hal } // namespace iree diff --git a/runtime/src/iree/hal/cts/cts_test_template.cc.in b/runtime/src/iree/hal/cts/cts_test_template.cc.in index 33b0eef4fb0e..15fb53fc3e3a 100644 --- a/runtime/src/iree/hal/cts/cts_test_template.cc.in +++ b/runtime/src/iree/hal/cts/cts_test_template.cc.in @@ -8,7 +8,6 @@ #cmakedefine IREE_CTS_TEST_FILE_PATH "@IREE_CTS_TEST_FILE_PATH@" #cmakedefine IREE_CTS_DRIVER_REGISTRATION_HDR "@IREE_CTS_DRIVER_REGISTRATION_HDR@" #cmakedefine IREE_CTS_DRIVER_REGISTRATION_FN @IREE_CTS_DRIVER_REGISTRATION_FN@ -#cmakedefine IREE_CTS_TEST_CLASS_NAME @IREE_CTS_TEST_CLASS_NAME@ #cmakedefine IREE_CTS_DRIVER_NAME "@IREE_CTS_DRIVER_NAME@" #cmakedefine IREE_CTS_EXECUTABLE_FORMAT @IREE_CTS_EXECUTABLE_FORMAT@ #cmakedefine IREE_CTS_EXECUTABLES_TESTDATA_HDR "@IREE_CTS_EXECUTABLES_TESTDATA_HDR@" @@ -30,6 +29,10 @@ namespace iree { namespace hal { namespace cts { +const char* get_test_driver_name() { + return IREE_CTS_DRIVER_NAME; +} + iree_status_t register_test_driver(iree_hal_driver_registry_t* registry) { return IREE_CTS_DRIVER_REGISTRATION_FN(registry); } @@ -62,10 +65,6 @@ iree_const_byte_span_t get_test_executable_data(iree_string_view_t file_name) { return iree_const_byte_span_empty(); } -INSTANTIATE_TEST_SUITE_P(CTS, IREE_CTS_TEST_CLASS_NAME, - ::testing::Values(IREE_CTS_DRIVER_NAME), - GenerateTestName()); - } // namespace cts } // namespace hal } // namespace iree diff --git a/runtime/src/iree/hal/cts/descriptor_set_layout_test.h b/runtime/src/iree/hal/cts/descriptor_set_layout_test.h index 4e66d6198b2e..401220a12f08 100644 --- a/runtime/src/iree/hal/cts/descriptor_set_layout_test.h +++ b/runtime/src/iree/hal/cts/descriptor_set_layout_test.h @@ -17,11 +17,11 @@ namespace iree { namespace hal { namespace cts { -class descriptor_set_layout_test : public CtsTestBase {}; +class descriptor_set_layout_test : public CTSTestBase<> {}; // Note: bindingCount == 0 is valid in VkDescriptorSetLayoutCreateInfo: // https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorSetLayoutCreateInfo.html -TEST_P(descriptor_set_layout_test, CreateWithNoBindings) { +TEST_F(descriptor_set_layout_test, CreateWithNoBindings) { iree_hal_descriptor_set_layout_t* descriptor_set_layout = NULL; IREE_ASSERT_OK(iree_hal_descriptor_set_layout_create( device_, IREE_HAL_DESCRIPTOR_SET_LAYOUT_FLAG_NONE, @@ -30,7 +30,7 @@ TEST_P(descriptor_set_layout_test, CreateWithNoBindings) { iree_hal_descriptor_set_layout_release(descriptor_set_layout); } -TEST_P(descriptor_set_layout_test, CreateWithOneBinding) { +TEST_F(descriptor_set_layout_test, CreateWithOneBinding) { iree_hal_descriptor_set_layout_t* descriptor_set_layout = NULL; iree_hal_descriptor_set_layout_binding_t descriptor_set_layout_bindings[] = { { @@ -46,7 +46,7 @@ TEST_P(descriptor_set_layout_test, CreateWithOneBinding) { iree_hal_descriptor_set_layout_release(descriptor_set_layout); } -TEST_P(descriptor_set_layout_test, CreateWithTwoBindings) { +TEST_F(descriptor_set_layout_test, CreateWithTwoBindings) { iree_hal_descriptor_set_layout_t* descriptor_set_layout = NULL; iree_hal_descriptor_set_layout_binding_t descriptor_set_layout_bindings[] = { { @@ -67,7 +67,7 @@ TEST_P(descriptor_set_layout_test, CreateWithTwoBindings) { iree_hal_descriptor_set_layout_release(descriptor_set_layout); } -TEST_P(descriptor_set_layout_test, CreateWithPushDescriptorType) { +TEST_F(descriptor_set_layout_test, CreateWithPushDescriptorType) { iree_hal_descriptor_set_layout_t* descriptor_set_layout = NULL; iree_hal_descriptor_set_layout_binding_t descriptor_set_layout_bindings[] = { { diff --git a/runtime/src/iree/hal/cts/driver_test.h b/runtime/src/iree/hal/cts/driver_test.h index 7672d9b29d1c..092dd75a7df8 100644 --- a/runtime/src/iree/hal/cts/driver_test.h +++ b/runtime/src/iree/hal/cts/driver_test.h @@ -20,7 +20,7 @@ namespace iree { namespace hal { namespace cts { -class driver_test : public CtsTestBase { +class driver_test : public CTSTestBase<> { protected: void CheckCreateDeviceViaPath(iree_string_view_t name, iree_string_view_t path) { @@ -46,7 +46,7 @@ class driver_test : public CtsTestBase { } }; -TEST_P(driver_test, QueryAndCreateAvailableDevicesByID) { +TEST_F(driver_test, QueryAndCreateAvailableDevicesByID) { iree_host_size_t device_info_count = 0; iree_hal_device_info_t* device_infos = NULL; IREE_ASSERT_OK(iree_hal_driver_query_available_devices( @@ -71,7 +71,7 @@ TEST_P(driver_test, QueryAndCreateAvailableDevicesByID) { iree_allocator_free(iree_allocator_system(), device_infos); } -TEST_P(driver_test, QueryAndCreateAvailableDevicesByOrdinal) { +TEST_F(driver_test, QueryAndCreateAvailableDevicesByOrdinal) { iree_host_size_t device_info_count = 0; iree_hal_device_info_t* device_infos = NULL; IREE_ASSERT_OK(iree_hal_driver_query_available_devices( @@ -96,7 +96,7 @@ TEST_P(driver_test, QueryAndCreateAvailableDevicesByOrdinal) { iree_allocator_free(iree_allocator_system(), device_infos); } -TEST_P(driver_test, QueryAndCreateAvailableDevicesByPath) { +TEST_F(driver_test, QueryAndCreateAvailableDevicesByPath) { iree_host_size_t device_info_count = 0; iree_hal_device_info_t* device_infos = NULL; IREE_ASSERT_OK(iree_hal_driver_query_available_devices( diff --git a/runtime/src/iree/hal/cts/event_test.h b/runtime/src/iree/hal/cts/event_test.h index a5d2c3e2faf9..47808a094304 100644 --- a/runtime/src/iree/hal/cts/event_test.h +++ b/runtime/src/iree/hal/cts/event_test.h @@ -19,15 +19,15 @@ namespace iree { namespace hal { namespace cts { -class event_test : public CtsTestBase {}; +class event_test : public CTSTestBase<> {}; -TEST_P(event_test, Create) { +TEST_F(event_test, Create) { iree_hal_event_t* event = NULL; IREE_ASSERT_OK(iree_hal_event_create(device_, &event)); iree_hal_event_release(event); } -TEST_P(event_test, SignalAndReset) { +TEST_F(event_test, SignalAndReset) { iree_hal_event_t* event = NULL; IREE_ASSERT_OK(iree_hal_event_create(device_, &event)); @@ -50,7 +50,7 @@ TEST_P(event_test, SignalAndReset) { iree_hal_command_buffer_release(command_buffer); } -TEST_P(event_test, SubmitWithChainedCommandBuffers) { +TEST_F(event_test, SubmitWithChainedCommandBuffers) { iree_hal_event_t* event = NULL; IREE_ASSERT_OK(iree_hal_event_create(device_, &event)); diff --git a/runtime/src/iree/hal/cts/executable_cache_test.h b/runtime/src/iree/hal/cts/executable_cache_test.h index 53882d7efbd0..cb130e4e2b8e 100644 --- a/runtime/src/iree/hal/cts/executable_cache_test.h +++ b/runtime/src/iree/hal/cts/executable_cache_test.h @@ -18,9 +18,9 @@ namespace iree { namespace hal { namespace cts { -class executable_cache_test : public CtsTestBase {}; +class executable_cache_test : public CTSTestBase<> {}; -TEST_P(executable_cache_test, Create) { +TEST_F(executable_cache_test, Create) { iree_status_t loop_status = iree_ok_status(); iree_hal_executable_cache_t* executable_cache = NULL; IREE_ASSERT_OK(iree_hal_executable_cache_create( @@ -31,7 +31,7 @@ TEST_P(executable_cache_test, Create) { IREE_ASSERT_OK(loop_status); } -TEST_P(executable_cache_test, CantPrepareUnknownFormat) { +TEST_F(executable_cache_test, CantPrepareUnknownFormat) { iree_status_t loop_status = iree_ok_status(); iree_hal_executable_cache_t* executable_cache = NULL; IREE_ASSERT_OK(iree_hal_executable_cache_create( @@ -45,7 +45,7 @@ TEST_P(executable_cache_test, CantPrepareUnknownFormat) { IREE_ASSERT_OK(loop_status); } -TEST_P(executable_cache_test, PrepareExecutable) { +TEST_F(executable_cache_test, PrepareExecutable) { iree_status_t loop_status = iree_ok_status(); iree_hal_executable_cache_t* executable_cache = NULL; IREE_ASSERT_OK(iree_hal_executable_cache_create( diff --git a/runtime/src/iree/hal/cts/file_test.h b/runtime/src/iree/hal/cts/file_test.h index 9b7410345a44..b59e61a71abd 100644 --- a/runtime/src/iree/hal/cts/file_test.h +++ b/runtime/src/iree/hal/cts/file_test.h @@ -26,7 +26,7 @@ namespace { constexpr iree_device_size_t kMinimumAlignment = 128; } // namespace -class file_test : public CtsTestBase { +class file_test : public CTSTestBase<> { protected: void CreatePatternedDeviceBuffer(iree_device_size_t buffer_size, uint8_t pattern, @@ -86,7 +86,7 @@ class file_test : public CtsTestBase { }; // Reads the entire file into a buffer and check the contents match. -TEST_P(file_test, ReadEntireFile) { +TEST_F(file_test, ReadEntireFile) { iree_device_size_t file_size = 128; iree_hal_file_t* file = NULL; CreatePatternedMemoryFile(IREE_HAL_MEMORY_ACCESS_READ, file_size, 0xDEu, diff --git a/runtime/src/iree/hal/cts/pipeline_layout_test.h b/runtime/src/iree/hal/cts/pipeline_layout_test.h index 5da293c98ae5..1cb02cf99a08 100644 --- a/runtime/src/iree/hal/cts/pipeline_layout_test.h +++ b/runtime/src/iree/hal/cts/pipeline_layout_test.h @@ -17,9 +17,9 @@ namespace iree { namespace hal { namespace cts { -class pipeline_layout_test : public CtsTestBase {}; +class pipeline_layout_test : public CTSTestBase<> {}; -TEST_P(pipeline_layout_test, CreateWithNoLayouts) { +TEST_F(pipeline_layout_test, CreateWithNoLayouts) { iree_hal_pipeline_layout_t* pipeline_layout = NULL; IREE_ASSERT_OK(iree_hal_pipeline_layout_create(device_, /*push_constants=*/0, /*set_layout_count=*/0, NULL, @@ -28,7 +28,7 @@ TEST_P(pipeline_layout_test, CreateWithNoLayouts) { iree_hal_pipeline_layout_release(pipeline_layout); } -TEST_P(pipeline_layout_test, CreateWithPushConstants) { +TEST_F(pipeline_layout_test, CreateWithPushConstants) { iree_hal_pipeline_layout_t* pipeline_layout = NULL; // Note: The Vulkan maxPushConstantsSize limit must be at least 128 bytes: // https://www.khronos.org/registry/vulkan/specs/1.2/html/vkspec.html#limits-minmax @@ -39,7 +39,7 @@ TEST_P(pipeline_layout_test, CreateWithPushConstants) { iree_hal_pipeline_layout_release(pipeline_layout); } -TEST_P(pipeline_layout_test, CreateWithOneLayout) { +TEST_F(pipeline_layout_test, CreateWithOneLayout) { iree_hal_descriptor_set_layout_t* descriptor_set_layout = NULL; iree_hal_descriptor_set_layout_binding_t descriptor_set_layout_bindings[] = { { @@ -67,7 +67,7 @@ TEST_P(pipeline_layout_test, CreateWithOneLayout) { iree_hal_descriptor_set_layout_release(descriptor_set_layout); } -TEST_P(pipeline_layout_test, CreateWithTwoLayouts) { +TEST_F(pipeline_layout_test, CreateWithTwoLayouts) { iree_hal_descriptor_set_layout_t* descriptor_set_layouts[2] = {NULL}; iree_hal_descriptor_set_layout_binding_t layout_bindings_0[] = { { diff --git a/runtime/src/iree/hal/cts/semaphore_submission_test.h b/runtime/src/iree/hal/cts/semaphore_submission_test.h index 10ed5dc810ff..824471eb6b23 100644 --- a/runtime/src/iree/hal/cts/semaphore_submission_test.h +++ b/runtime/src/iree/hal/cts/semaphore_submission_test.h @@ -21,9 +21,9 @@ namespace iree { namespace hal { namespace cts { -class semaphore_submission_test : public CtsTestBase {}; +class semaphore_submission_test : public CTSTestBase<> {}; -TEST_P(semaphore_submission_test, SubmitWithNoCommandBuffers) { +TEST_F(semaphore_submission_test, SubmitWithNoCommandBuffers) { // No waits, one signal which we immediately wait on after submit. iree_hal_semaphore_t* signal_semaphore = CreateSemaphore(); uint64_t signal_payload_values[] = {1}; @@ -43,7 +43,7 @@ TEST_P(semaphore_submission_test, SubmitWithNoCommandBuffers) { iree_hal_semaphore_release(signal_semaphore); } -TEST_P(semaphore_submission_test, SubmitAndSignal) { +TEST_F(semaphore_submission_test, SubmitAndSignal) { iree_hal_command_buffer_t* command_buffer = CreateEmptyCommandBuffer(); // No waits, one signal which we immediately wait on after submit. @@ -66,7 +66,7 @@ TEST_P(semaphore_submission_test, SubmitAndSignal) { iree_hal_semaphore_release(signal_semaphore); } -TEST_P(semaphore_submission_test, SubmitWithWait) { +TEST_F(semaphore_submission_test, SubmitWithWait) { // Empty command buffer. iree_hal_command_buffer_t* command_buffer = CreateEmptyCommandBuffer(); @@ -105,7 +105,7 @@ TEST_P(semaphore_submission_test, SubmitWithWait) { iree_hal_semaphore_release(signal_semaphore); } -TEST_P(semaphore_submission_test, SubmitWithMultipleSemaphores) { +TEST_F(semaphore_submission_test, SubmitWithMultipleSemaphores) { iree_hal_command_buffer_t* command_buffer = CreateEmptyCommandBuffer(); iree_hal_semaphore_t* wait_semaphore_1 = CreateSemaphore(); @@ -154,7 +154,7 @@ TEST_P(semaphore_submission_test, SubmitWithMultipleSemaphores) { } // Tests we can wait on both host and device semaphore to singal. -TEST_P(semaphore_submission_test, WaitAllHostAndDeviceSemaphores) { +TEST_F(semaphore_submission_test, WaitAllHostAndDeviceSemaphores) { iree_hal_command_buffer_t* command_buffer = CreateEmptyCommandBuffer(); // Create two semaphores, one for the host thread to wait on, and one for the @@ -217,7 +217,7 @@ TEST_P(semaphore_submission_test, WaitAllHostAndDeviceSemaphores) { // Tests that we can wait on any host and device semaphore to singal, // and device signals. -TEST_P(semaphore_submission_test, +TEST_F(semaphore_submission_test, WaitAnyHostAndDeviceSemaphoresAndDeviceSignals) { iree_hal_command_buffer_t* command_buffer = CreateEmptyCommandBuffer(); @@ -286,7 +286,7 @@ TEST_P(semaphore_submission_test, // Tests we can wait on any host and device semaphore to singal, // and host signals. -TEST_P(semaphore_submission_test, +TEST_F(semaphore_submission_test, WaitAnyHostAndDeviceSemaphoresAndHostSignals) { iree_hal_command_buffer_t* command_buffer = CreateEmptyCommandBuffer(); @@ -359,7 +359,7 @@ TEST_P(semaphore_submission_test, // Test device -> device synchronization: submit two batches with a // semaphore signal -> wait dependency. -TEST_P(semaphore_submission_test, IntermediateSemaphoreBetweenDeviceBatches) { +TEST_F(semaphore_submission_test, IntermediateSemaphoreBetweenDeviceBatches) { // The signaling relationship is // command_buffer1 -> semaphore1 -> command_buffer2 -> semaphore2 @@ -419,7 +419,7 @@ TEST_P(semaphore_submission_test, IntermediateSemaphoreBetweenDeviceBatches) { // Test device -> device synchronization: submit multiple batches with // multiple later batches waiting on the same signaling from a former batch. -TEST_P(semaphore_submission_test, TwoBatchesWaitingOn1FormerBatchAmongst2) { +TEST_F(semaphore_submission_test, TwoBatchesWaitingOn1FormerBatchAmongst2) { // The signaling-wait relation is: // command_buffer11 command_buffer12 // ↓ @@ -502,7 +502,7 @@ TEST_P(semaphore_submission_test, TwoBatchesWaitingOn1FormerBatchAmongst2) { // Test device -> device synchronization: submit multiple batches with // a former batch signaling a value greater than all other batches' (different) // wait values. -TEST_P(semaphore_submission_test, TwoBatchesWaitingOnDifferentSemaphoreValues) { +TEST_F(semaphore_submission_test, TwoBatchesWaitingOnDifferentSemaphoreValues) { // The signal-wait relation is // // command_buffer11 @@ -590,7 +590,7 @@ TEST_P(semaphore_submission_test, TwoBatchesWaitingOnDifferentSemaphoreValues) { // Test host + device -> device synchronization: submit two batches // with a later batch waiting on both a host and device signal to proceed. -TEST_P(semaphore_submission_test, BatchWaitingOnAnotherAndHostSignal) { +TEST_F(semaphore_submission_test, BatchWaitingOnAnotherAndHostSignal) { // Signal/wait relation: // // command_buffer1 @@ -665,7 +665,7 @@ TEST_P(semaphore_submission_test, BatchWaitingOnAnotherAndHostSignal) { // Test device -> host + device synchronization: submit two batches // with a former batch signaling to enable both host and device to proceed. -TEST_P(semaphore_submission_test, DeviceBatchSignalAnotherAndHost) { +TEST_F(semaphore_submission_test, DeviceBatchSignalAnotherAndHost) { // Signal-wait relation: // // command_buffer1 @@ -753,7 +753,7 @@ TEST_P(semaphore_submission_test, DeviceBatchSignalAnotherAndHost) { // Test signaling a larger value before enqueuing waiting a smaller // value to the device. -TEST_P(semaphore_submission_test, BatchWaitingOnSmallerValueAfterSignaled) { +TEST_F(semaphore_submission_test, BatchWaitingOnSmallerValueAfterSignaled) { // signal-wait relation: // // signal value 2 @@ -797,7 +797,7 @@ TEST_P(semaphore_submission_test, BatchWaitingOnSmallerValueAfterSignaled) { // Test signaling a larger value after enqueuing waiting a smaller // value to the device. -TEST_P(semaphore_submission_test, BatchWaitingOnSmallerValueBeforeSignaled) { +TEST_F(semaphore_submission_test, BatchWaitingOnSmallerValueBeforeSignaled) { // signal-wait relation: // // signal value 2 diff --git a/runtime/src/iree/hal/cts/semaphore_test.h b/runtime/src/iree/hal/cts/semaphore_test.h index f7256d55b8e1..da2f297d069c 100644 --- a/runtime/src/iree/hal/cts/semaphore_test.h +++ b/runtime/src/iree/hal/cts/semaphore_test.h @@ -22,10 +22,10 @@ namespace hal { namespace cts { using namespace std::chrono_literals; -class semaphore_test : public CtsTestBase {}; +class semaphore_test : public CTSTestBase<> {}; // Tests that a semaphore that is unused properly cleans itself up. -TEST_P(semaphore_test, NoOp) { +TEST_F(semaphore_test, NoOp) { iree_hal_semaphore_t* semaphore = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 123ull, &semaphore)); @@ -37,7 +37,7 @@ TEST_P(semaphore_test, NoOp) { } // Tests that a semaphore will accept new values as it is signaled. -TEST_P(semaphore_test, NormalSignaling) { +TEST_F(semaphore_test, NormalSignaling) { iree_hal_semaphore_t* semaphore = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 2ull, &semaphore)); @@ -59,7 +59,7 @@ TEST_P(semaphore_test, NormalSignaling) { // while others may accept the new, decreasing, values. // Tests semaphore failure handling. -TEST_P(semaphore_test, Failure) { +TEST_F(semaphore_test, Failure) { iree_hal_semaphore_t* semaphore = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 2ull, &semaphore)); @@ -80,7 +80,7 @@ TEST_P(semaphore_test, Failure) { } // Tests waiting on no semaphores. -TEST_P(semaphore_test, EmptyWait) { +TEST_F(semaphore_test, EmptyWait) { IREE_ASSERT_OK(iree_hal_device_wait_semaphores( device_, IREE_HAL_WAIT_MODE_ANY, iree_hal_semaphore_list_empty(), iree_make_deadline(IREE_TIME_INFINITE_FUTURE))); @@ -97,7 +97,7 @@ TEST_P(semaphore_test, EmptyWait) { } // Tests waiting on a semaphore that has already been signaled. -TEST_P(semaphore_test, WaitAlreadySignaled) { +TEST_F(semaphore_test, WaitAlreadySignaled) { iree_hal_semaphore_t* semaphore = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 2ull, &semaphore)); @@ -116,7 +116,7 @@ TEST_P(semaphore_test, WaitAlreadySignaled) { } // Tests waiting on a semaphore that has not been signaled. -TEST_P(semaphore_test, WaitUnsignaled) { +TEST_F(semaphore_test, WaitUnsignaled) { iree_hal_semaphore_t* semaphore = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 2ull, &semaphore)); @@ -130,7 +130,7 @@ TEST_P(semaphore_test, WaitUnsignaled) { } // Tests waiting on a semaphore that has signals past the desired value. -TEST_P(semaphore_test, WaitLaterSignaledBeyond) { +TEST_F(semaphore_test, WaitLaterSignaledBeyond) { iree_hal_semaphore_t* semaphore = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 2ull, &semaphore)); @@ -152,7 +152,7 @@ TEST_P(semaphore_test, WaitLaterSignaledBeyond) { // return UnknownError while others may succeed. // Tests IREE_HAL_WAIT_MODE_ALL when not all are signaled. -TEST_P(semaphore_test, WaitAllButNotAllSignaled) { +TEST_F(semaphore_test, WaitAllButNotAllSignaled) { iree_hal_semaphore_t* semaphore_a = NULL; iree_hal_semaphore_t* semaphore_b = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 0ull, &semaphore_a)); @@ -177,7 +177,7 @@ TEST_P(semaphore_test, WaitAllButNotAllSignaled) { } // Tests IREE_HAL_WAIT_MODE_ALL when all are signaled. -TEST_P(semaphore_test, WaitAllAndAllSignaled) { +TEST_F(semaphore_test, WaitAllAndAllSignaled) { iree_hal_semaphore_t* semaphore_a = NULL; iree_hal_semaphore_t* semaphore_b = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 1ull, &semaphore_a)); @@ -202,7 +202,7 @@ TEST_P(semaphore_test, WaitAllAndAllSignaled) { } // Tests IREE_HAL_WAIT_MODE_ANY. -TEST_P(semaphore_test, WaitAnyAlreadySignaled) { +TEST_F(semaphore_test, WaitAnyAlreadySignaled) { iree_hal_semaphore_t* semaphore_a = NULL; iree_hal_semaphore_t* semaphore_b = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 0ull, &semaphore_a)); @@ -223,7 +223,7 @@ TEST_P(semaphore_test, WaitAnyAlreadySignaled) { iree_hal_semaphore_release(semaphore_b); } -TEST_P(semaphore_test, WaitAnyLaterSignaled) { +TEST_F(semaphore_test, WaitAnyLaterSignaled) { iree_hal_semaphore_t* semaphore_a = NULL; iree_hal_semaphore_t* semaphore_b = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 0ull, &semaphore_a)); @@ -253,7 +253,7 @@ TEST_P(semaphore_test, WaitAnyLaterSignaled) { // Tests threading behavior by ping-ponging between the test main thread and // a little thread. -TEST_P(semaphore_test, PingPong) { +TEST_F(semaphore_test, PingPong) { iree_hal_semaphore_t* a2b = NULL; iree_hal_semaphore_t* b2a = NULL; IREE_ASSERT_OK(iree_hal_semaphore_create(device_, 0ull, &a2b)); @@ -278,7 +278,7 @@ TEST_P(semaphore_test, PingPong) { } // Waiting the same value multiple times. -TEST_P(semaphore_test, WaitOnTheSameValueMultipleTimes) { +TEST_F(semaphore_test, WaitOnTheSameValueMultipleTimes) { iree_hal_semaphore_t* semaphore = CreateSemaphore(); std::thread thread( [&]() { IREE_ASSERT_OK(iree_hal_semaphore_signal(semaphore, 1)); }); @@ -297,7 +297,7 @@ TEST_P(semaphore_test, WaitOnTheSameValueMultipleTimes) { } // Waiting for a finite amount of time. -TEST_P(semaphore_test, WaitForFiniteTime) { +TEST_F(semaphore_test, WaitForFiniteTime) { auto generic_test_fn = [this](auto wait_fn) { iree_hal_semaphore_t* semaphore = this->CreateSemaphore(); @@ -341,7 +341,7 @@ TEST_P(semaphore_test, WaitForFiniteTime) { } // Wait on all semaphores on multiple places simultaneously. -TEST_P(semaphore_test, SimultaneousMultiWaitAll) { +TEST_F(semaphore_test, SimultaneousMultiWaitAll) { iree_hal_semaphore_t* semaphore1 = this->CreateSemaphore(); iree_hal_semaphore_t* semaphore2 = this->CreateSemaphore();