Skip to content

Commit acb9ca3

Browse files
committed
Don't use empty match test files
This patch removes any empty ".match" files, and instructs ctest to run the tests verbatim if there is no match file available. As well as providing more useful output, this also handles the case where the test startup and/or teardown causes the test runner to fail. Previously, this would be ignored (as it produced no output). I also modified cts_exe.py so that it uses the same parameters as ctest, so the same command invocation could be used for both.
1 parent 6d9c97f commit acb9ca3

File tree

48 files changed

+8
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+8
-7
lines changed

test/conformance/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ function(add_test_adapter name adapter)
1717
set(TEST_NAME ${name}-${adapter}${EXTRA_NAME})
1818

1919
set(TEST_COMMAND
20-
"${PROJECT_BINARY_DIR}/bin/${TEST_TARGET_NAME} --test_devices_count=${UR_TEST_DEVICES_COUNT} --test_platforms_count=${UR_TEST_PLATFORMS_COUNT}"
20+
"${PROJECT_BINARY_DIR}/bin/${TEST_TARGET_NAME} --devices_count=${UR_TEST_DEVICES_COUNT} --platforms_count=${UR_TEST_PLATFORMS_COUNT}"
2121
)
22+
set(MATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${name}_${adapter}${EXTRA_NAME}.match")
2223

23-
if(UR_CONFORMANCE_ENABLE_MATCH_FILES)
24+
if(${UR_CONFORMANCE_ENABLE_MATCH_FILES} AND EXISTS ${MATCH_FILE})
2425
add_test(NAME ${TEST_NAME}
2526
COMMAND ${CMAKE_COMMAND}
2627
-D TEST_FILE=${Python3_EXECUTABLE}
2728
-D TEST_ARGS="${UR_CONFORMANCE_TEST_DIR}/cts_exe.py --test_command ${TEST_COMMAND}"
2829
-D MODE=stdout
29-
-D MATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${name}_${adapter}${EXTRA_NAME}.match
30+
-D MATCH_FILE=${MATCH_FILE}
3031
-P ${PROJECT_SOURCE_DIR}/cmake/match.cmake
3132
DEPENDS ${TEST_TARGET_NAME}
3233
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}

test/conformance/adapter/adapter_adapter_cuda.match

Whitespace-only changes.

test/conformance/adapter/adapter_adapter_hip.match

Whitespace-only changes.

test/conformance/adapter/adapter_adapter_level_zero.match

Whitespace-only changes.

test/conformance/adapter/adapter_adapter_level_zero_v2.match

Whitespace-only changes.

test/conformance/adapter/adapter_adapter_opencl.match

Whitespace-only changes.

test/conformance/context/context_adapter_cuda.match

Whitespace-only changes.

test/conformance/context/context_adapter_hip.match

Whitespace-only changes.

test/conformance/context/context_adapter_opencl.match

Whitespace-only changes.

test/conformance/cts_exe.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121

2222
parser = ArgumentParser()
2323
parser.add_argument("--test_command", help="Ctest test case")
24-
parser.add_argument("--test_devices_count", type=str, help="Number of devices on which tests will be run")
25-
parser.add_argument("--test_platforms_count", type=str, help="Number of platforms on which tests will be run")
24+
parser.add_argument("--devices_count", type=str, help="Number of devices on which tests will be run")
25+
parser.add_argument("--platforms_count", type=str, help="Number of platforms on which tests will be run")
2626
args = parser.parse_args()
2727

2828
result = subprocess.Popen([args.test_command, '--gtest_brief=1', # nosec B603
29-
f'--devices_count={args.test_devices_count}',
30-
f'--platforms_count={args.test_platforms_count}'],
29+
f'--devices_count={args.devices_count}',
30+
f'--platforms_count={args.platforms_count}'],
3131
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
3232

3333
pat = re.compile(r'\[( )*FAILED( )*\]')

0 commit comments

Comments
 (0)