[llvm-commits] [test-suite] r125143 - /test-suite/trunk/RunSafely.sh

Daniel Dunbar daniel at zuster.org
Tue Feb 8 16:37:50 PST 2011


Author: ddunbar
Date: Tue Feb  8 18:37:50 2011
New Revision: 125143

URL: http://llvm.org/viewvc/llvm-project?rev=125143&view=rev
Log:
RunSafely: Add support for a -t argument to change the time command to use.

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=125143&r1=125142&r2=125143&view=diff
==============================================================================
--- test-suite/trunk/RunSafely.sh (original)
+++ test-suite/trunk/RunSafely.sh Tue Feb  8 18:37:50 2011
@@ -57,6 +57,7 @@
 RCLIENT=rsh
 RPORT=
 RUN_UNDER=
+TIMEIT=time
 if [ $1 = "-r" ]; then
   RHOST=$2
   shift 2
@@ -77,6 +78,10 @@
   RUN_UNDER=$2
   shift 2
 fi
+if [ $1 = "-t" ]; then
+  TIMEIT=$2
+  shift 2
+fi
 
 ULIMIT=$1
 EXITOK=$2
@@ -133,7 +138,7 @@
 COMMAND=$(echo "$COMMAND" | sed -e 's#"#\\"#g')
 
 if [ "x$RHOST" = x ] ; then
-  ( sh -c "$ULIMITCMD time -p sh -c '$COMMAND >$OUTFILE 2>&1 < $INFILE; echo exit \$?'" ) 2>&1 \
+  ( sh -c "$ULIMITCMD $TIMEIT -p sh -c '$COMMAND >$OUTFILE 2>&1 < $INFILE; echo exit \$?'" ) 2>&1 \
     | awk -- '\
 BEGIN     { cpu = 0.0; }
 /^user/   { cpu += $2; print; }
@@ -143,7 +148,7 @@
   rm -f "$PWD/${PROG}.command"
   rm -f "$PWD/${PROG}.remote"
   rm -f "$PWD/${PROG}.remote.time"
-  echo "$ULIMITCMD cd $PWD; (time -p ($COMMAND > $PWD/${OUTFILE}.remote 2>&1 < $INFILE;); echo exit \$?) > $PWD/${OUTFILE}.remote.time 2>&1" > "$PWD/${PROG}.command"
+  echo "$ULIMITCMD cd $PWD; ($TIMEIT -p ($COMMAND > $PWD/${OUTFILE}.remote 2>&1 < $INFILE;); echo exit \$?) > $PWD/${OUTFILE}.remote.time 2>&1" > "$PWD/${PROG}.command"
   chmod +x "$PWD/${PROG}.command"
 
   ( $RCLIENT -l $RUSER $RHOST $RPORT "ls $PWD/${PROG}.command" ) > /dev/null 2>&1





More information about the llvm-commits mailing list