[test-suite] r259907 - RunSafely: Base the XXX.command filename on OUTFILE not on the programname

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 11:30:04 PST 2016


Author: matze
Date: Fri Feb  5 13:30:04 2016
New Revision: 259907

URL: http://llvm.org/viewvc/llvm-project?rev=259907&view=rev
Log:
RunSafely: Base the XXX.command filename on OUTFILE not on the programname

Otherwise they will overwrite each other when we invoke the same
executable mutliple files. This was producing race conditions for a
device connected through NFS for me.

Note: This does not affect the Makefile based test-suite as it never
runs an executable more than once.

Modified:
    test-suite/trunk/RunSafely.sh

Modified: test-suite/trunk/RunSafely.sh
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/RunSafely.sh?rev=259907&r1=259906&r2=259907&view=diff
==============================================================================
--- test-suite/trunk/RunSafely.sh (original)
+++ test-suite/trunk/RunSafely.sh Fri Feb  5 13:30:04 2016
@@ -200,13 +200,13 @@ else
   rm -f "${STDOUT_FILE}${REMOTE_SUFFIX}" "${STDERR_FILE}${REMOTE_SUFFIX}"
 
   # Create .command script
-  PROG_BASENAME="$(basename ${PROG})"
-  rm -f "$PWD/${PROG_BASENAME}.command"
-  echo "$TIMEIT $TIMEITFLAGS $COMMAND" > "$PWD/${PROG_BASENAME}.command"
-  chmod +x "$PWD/${PROG_BASENAME}.command"
+  COMMANDFILE="${OUTFILE}.command"
+  rm -f "${COMMANDFILE}"
+  echo "$TIMEIT $TIMEITFLAGS $COMMAND" > "${COMMANDFILE}"
+  chmod +x "${COMMANDFILE}"
 
-  ( $RCLIENT $RFLAGS $RHOST "ls $PWD/${PROG_BASENAME}.command" ) > /dev/null 2>&1
-  ( $RCLIENT $RFLAGS $RHOST "$PWD/${PROG_BASENAME}.command" )
+  ( $RCLIENT $RFLAGS $RHOST "ls ${COMMANDFILE}" ) > /dev/null 2>&1
+  ( $RCLIENT $RFLAGS $RHOST "${COMMANDFILE}" )
   sleep 1
 
   # Copy remote files back




More information about the llvm-commits mailing list