From 91ffa03af1cc32515190c3b52d7b964f5abead5f Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Mar 2023 14:54:28 +0100 Subject: [PATCH] [gdb/testsuite] Use gdb_remote_download in allow_opencl_tests Simon reported that doing: ... $ while make check-parallel TESTS='gdb.opencl/*.exp' -j 100; do true; done ... could run into: ... ERROR: remote_download to target of \ /data/vries/gdb/src/gdb/testsuite/lib/opencl_kernel.cl to opencl_kernel.cl: \ cp: cannot create regular file 'opencl_kernel.cl': File exists ... Fix this by using gdb_remote_download (instead of plain remote_download) in allow_opencl_test, which takes care of: - downloading to a location which is safe for parallel testing, by using standard_output_file, and - cleaning up the downloaded file, meaning we can remove the corresponding "remote_file target delete ${clprogram}" lines in allow_opencl_test. Tested on x86_64-linux. Reported-by: Simon Marchi --- gdb/testsuite/lib/opencl.exp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gdb/testsuite/lib/opencl.exp b/gdb/testsuite/lib/opencl.exp index dc7966443d5..e878c4e87ae 100644 --- a/gdb/testsuite/lib/opencl.exp +++ b/gdb/testsuite/lib/opencl.exp @@ -38,14 +38,13 @@ gdb_caching_proc allow_opencl_tests {} { # Set up, compile, and execute an OpenCL program. Include the current # process ID in the file name of the executable to prevent conflicts with # invocations for multiple testsuites. - set clprogram [remote_download target ${srcdir}/lib/opencl_kernel.cl] + set clprogram [gdb_remote_download target ${srcdir}/lib/opencl_kernel.cl] set executable opencltest[pid].x verbose "$me: compiling OpenCL test app" 2 set compile_flags {debug nowarnings quiet} if { [gdb_compile_opencl_hostapp "${clprogram}" "${executable}" "${compile_flags}" ] != "" } { - remote_file target delete ${clprogram} verbose "$me: compiling OpenCL binary failed, returning 0" 2 return 0 } @@ -70,9 +69,6 @@ gdb_caching_proc allow_opencl_tests {} { gdb_exit remote_file build delete $executable - # Delete the OpenCL program source file. - remote_file target delete ${clprogram} - verbose "$me: returning $result" 2 return $result } -- 2.30.2