Mercurial > projects > ldc
diff tests/runtest @ 186:395223f9875e trunk
[svn r202] added start of dstress-based test suite to tests/
author | ChristianK |
---|---|
date | Thu, 08 May 2008 22:32:22 +0200 |
parents | |
children | 7949d3dd0341 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/runtest Thu May 08 22:32:22 2008 +0200 @@ -0,0 +1,50 @@ +#!/bin/bash + +# check for command line arguments +if [ -z $1 ] ; then + echo "Usage: `basename $0` <test result file>" + exit +fi +TARGETFILE=$1 + +# check for dstress +if ! [ -d dstress ] ; then + echo "Testing requires DStress to be checked out into dstress/" + exit +fi + +cd dstress + +# remove excessive tests +sed -e 's/torture-//g' -i Makefile + +# make sure only .d files in 'run' tests are run +sed -e 's/find run -type f |/find run -type f -name "*\\\\.d" |/' -i Makefile +sed -e 's/find norun -type f |/find norun -type f -name "*\\\\.d" |/' -i Makefile + +# make sure linker-generated bc files are deleted +sed -e 's/find run -type f -name "\*\\\\\.exe" |/find run -type f -name "*\\\\.exe" -o -name "*\\\\.bc" |/' -i Makefile +sed -e 's/find norun -type f -name "\*\\\\\.exe" |/find norun -type f -name "*\\\\.exe" -o -name "*\\\\.bc" |/' -i Makefile + +# impose more conservative constraints (10s and 256 MB) +sed -e 's/crashRun 30 1000/crashRun 10 256/' -i dstress.c + +echo +echo "Running new test and storing result in $TARGETFILE ..." +echo + +if [ -z $DMD ] ; then + echo "Testing with llvmdc. Set DMD environment variable to select compiler." + DMD="llvmdc" +else + echo "Using compiler given by DMD environment variable: $DMD" +fi + +echo +echo "This will take a while, try 'tail -f $TARGETFILE' to follow progress." +echo "Note that aborting is tricky. Try killing the processes by the name of" +echo "run.sh, compile.sh, nocompile.sh and norun.sh as well as this one." +echo + +DMD=$DMD make > ../$TARGETFILE +cd ..