| 1 |
#!/bin/sh |
|---|
| 2 |
|
|---|
| 3 |
# check for command line arguments |
|---|
| 4 |
if [ -z "$1" ] ; then |
|---|
| 5 |
echo "Usage: `basename $0` <test result file>" |
|---|
| 6 |
exit |
|---|
| 7 |
fi |
|---|
| 8 |
TARGETFILE=$1 |
|---|
| 9 |
|
|---|
| 10 |
# build libtangobos-partial |
|---|
| 11 |
echo "Building libtangobos-partial.a" |
|---|
| 12 |
cd testincludes |
|---|
| 13 |
make |
|---|
| 14 |
cd .. |
|---|
| 15 |
|
|---|
| 16 |
# check for dstress |
|---|
| 17 |
if ! [ -d dstress ] ; then |
|---|
| 18 |
echo "Testing requires DStress to be checked out into dstress/" |
|---|
| 19 |
exit |
|---|
| 20 |
fi |
|---|
| 21 |
|
|---|
| 22 |
BASEPATH=`pwd` |
|---|
| 23 |
cd dstress |
|---|
| 24 |
|
|---|
| 25 |
# remove excessive tests |
|---|
| 26 |
sed -e 's/torture-//g' -i Makefile |
|---|
| 27 |
|
|---|
| 28 |
# make sure only .d files in 'run' tests are run |
|---|
| 29 |
sed -e 's/find run -type f |/find run -type f -name "*\\\\.d" |/' -i Makefile |
|---|
| 30 |
sed -e 's/find norun -type f |/find norun -type f -name "*\\\\.d" |/' -i Makefile |
|---|
| 31 |
|
|---|
| 32 |
# impose more conservative constraints (10s and 256 MB) |
|---|
| 33 |
sed -e 's/crashRun 30 1000/crashRun 10 256/' -i dstress.c |
|---|
| 34 |
|
|---|
| 35 |
echo |
|---|
| 36 |
echo "Running new test and storing result in $TARGETFILE ..." |
|---|
| 37 |
echo |
|---|
| 38 |
echo "Remember to make sure you have an up to date runtime!" |
|---|
| 39 |
echo |
|---|
| 40 |
|
|---|
| 41 |
if [ -z "$DMD" ] ; then |
|---|
| 42 |
echo "Testing with LDC. Set DMD environment variable to select compiler." |
|---|
| 43 |
DMD="ldmd -I$BASEPATH/testincludes -L$BASEPATH/testincludes/libtangobos-partial.a" |
|---|
| 44 |
echo "Default is $DMD" |
|---|
| 45 |
else |
|---|
| 46 |
echo "Using compiler given by DMD environment variable: $DMD" |
|---|
| 47 |
fi |
|---|
| 48 |
|
|---|
| 49 |
echo |
|---|
| 50 |
echo "This will take a while, try 'tail -f $TARGETFILE' to follow progress." |
|---|
| 51 |
echo "Note that aborting is tricky. Try killing the processes by the name of" |
|---|
| 52 |
echo "run.sh, compile.sh, nocompile.sh and norun.sh as well as this one." |
|---|
| 53 |
echo |
|---|
| 54 |
|
|---|
| 55 |
DMD=$DMD make compile nocompile run norun > ../$TARGETFILE |
|---|
| 56 |
cd .. |
|---|
| 57 |
|
|---|
| 58 |
echo |
|---|
| 59 |
echo "Cleanup... (removing all .o and .exe files)" |
|---|
| 60 |
echo |
|---|
| 61 |
|
|---|
| 62 |
find dstress -name "*\.o" -o -name "*\.exe" -delete |
|---|