Skip to content

Commit

Permalink
Merge pull request #2137 from RossBrunton/ross/smartmatch
Browse files Browse the repository at this point in the history
Don't use empty match test files
  • Loading branch information
RossBrunton authored Sep 26, 2024
2 parents a8c5c49 + acb9ca3 commit a21a230
Show file tree
Hide file tree
Showing 48 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions test/conformance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ function(add_test_adapter name adapter)
set(TEST_NAME ${name}-${adapter}${EXTRA_NAME})

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

if(UR_CONFORMANCE_ENABLE_MATCH_FILES)
if(${UR_CONFORMANCE_ENABLE_MATCH_FILES} AND EXISTS ${MATCH_FILE})
add_test(NAME ${TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-D TEST_FILE=${Python3_EXECUTABLE}
-D TEST_ARGS="${UR_CONFORMANCE_TEST_DIR}/cts_exe.py --test_command ${TEST_COMMAND}"
-D MODE=stdout
-D MATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${name}_${adapter}${EXTRA_NAME}.match
-D MATCH_FILE=${MATCH_FILE}
-P ${PROJECT_SOURCE_DIR}/cmake/match.cmake
DEPENDS ${TEST_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
8 changes: 4 additions & 4 deletions test/conformance/cts_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

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

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

pat = re.compile(r'\[( )*FAILED( )*\]')
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.

0 comments on commit a21a230

Please sign in to comment.