|
Lines 9-19
Link Here
|
| 9 |
echo " running as $USERNAME"; |
9 |
echo " running as $USERNAME"; |
| 10 |
echo " currently in dir: `pwd`"; |
10 |
echo " currently in dir: `pwd`"; |
| 11 |
|
11 |
|
|
|
12 |
# fix for org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] |
| 13 |
# fix for Failed to invoke suite():org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] |
| 14 |
export CVS_RSH=ssh |
| 15 |
ulimit -c unlimited; # set corefile size to unlimited |
| 16 |
|
| 17 |
echo "Set JAVA_HIGH_ZIPFDS=500 & LANG=C"; |
| 18 |
export JAVA_HIGH_ZIPFDS=500 |
| 19 |
export LANG=C |
| 20 |
|
| 21 |
# configure X server thread for tests; see http://wiki.eclipse.org/Modeling_Project_Releng/Building_Zips_And_Jars#UI_Testing |
| 22 |
xport=17; # should be a unique port number to avoid collisions -- see http://wiki.eclipse.org/Modeling_Project_Releng/Building#UI_Testing and sign up! |
| 23 |
echo "Start Xvfb on :${xport}" |
| 24 |
Xvfb :${xport} -ac & # -screen 0 1024x768x16 -ac & |
| 25 |
export DISPLAY=localhost:${xport}.0 |
| 26 |
xhost + |
| 27 |
|
| 28 |
#startkde & |
| 29 |
#sleep 40 |
| 30 |
# xwd -silent -display :${xport} -root -out /tmp/snap.xwd; # save a snapshot |
| 31 |
|
| 32 |
readPropertyOut=""; |
| 33 |
readProperty () |
| 34 |
{ |
| 35 |
readPropertyOut=""; |
| 36 |
file=$1 |
| 37 |
property=$2 |
| 38 |
readPropertyOut=$(grep $property $file | egrep -v "^#" | tail -1 | sed -e "s/$property=//"); |
| 39 |
} |
| 40 |
|
| 12 |
if [[ ! $JAVA_HOME ]]; then |
41 |
if [[ ! $JAVA_HOME ]]; then |
| 13 |
echo -n "[relengbuild] Get JAVA_HOME from build.cfg ... "; |
42 |
echo -n "[relengbuild] Get JAVA_HOME from build.cfg ... "; |
| 14 |
buildcfg=$PWD/../../../build.cfg; |
43 |
buildcfg=$PWD/../../../build.cfg; |
| 15 |
export JAVA_HOME=$(grep "JAVA_HOME=" $buildcfg | egrep -v "^#" | tail -1 | sed -e "s/JAVAHOME=//"); |
44 |
readProperty $buildcfg JAVA_HOME |
| 16 |
echo "$JAVA_HOME"; |
45 |
JAVA_HOME="$readPropertyOut"; |
|
|
46 |
javaHome="$readPropertyOut"; |
| 47 |
echo $JAVA_HOME |
| 17 |
fi |
48 |
fi |
| 18 |
|
49 |
|
| 19 |
Xflags=""; |
50 |
Xflags=""; |
|
Lines 70-100
Link Here
|
| 70 |
fi |
101 |
fi |
| 71 |
} |
102 |
} |
| 72 |
|
103 |
|
| 73 |
doFunction () |
|
|
| 74 |
{ |
| 75 |
cmd=$1; |
| 76 |
params=$2 |
| 77 |
for pth in "." "/bin" "/usr/bin" "/usr/bin/X11" "/usr/local/bin" "/usr/X11R6/bin" "`pwd`/../linux" ; do |
| 78 |
defined=0; |
| 79 |
checkIfDefined $pth/$cmd |
| 80 |
if [ $defined -eq 1 ] ; then |
| 81 |
$cmd $params |
| 82 |
sleep 3 |
| 83 |
break; |
| 84 |
fi |
| 85 |
done |
| 86 |
if [ $defined -eq 0 ] ; then |
| 87 |
echo "$cmd is not defined (command not found)"; |
| 88 |
fi |
| 89 |
} |
| 90 |
|
| 91 |
# these don't work on old build server, so not point wrapping them to say so when we can just omit |
| 92 |
# doFunction Xvfb ":42 -screen 0 1024x768x24 -ac & " |
| 93 |
# doFunction Xnest ":43 -display :42 -depth 24 & " |
| 94 |
# doFunction fvwm2 "-display localhost:43.0 & " |
| 95 |
#export DISPLAY=$HOSTNAME:43.0 |
| 96 |
#ulimit -c unlimited |
| 97 |
|
| 98 |
getBuildID() |
104 |
getBuildID() |
| 99 |
{ # given $PWD: /home/www-data/build/modeling/$projectName/$subprojectName/downloads/drops/1.1.0/N200702112049/testing/N200702112049/testing |
105 |
{ # given $PWD: /home/www-data/build/modeling/$projectName/$subprojectName/downloads/drops/1.1.0/N200702112049/testing/N200702112049/testing |
| 100 |
# return N200702110400 |
106 |
# return N200702110400 |
|
Lines 198-212
Link Here
|
| 198 |
$properties -logger org.apache.tools.ant.DefaultLogger" $consolelog; |
204 |
$properties -logger org.apache.tools.ant.DefaultLogger" $consolelog; |
| 199 |
echo "[runtests] [`date +%H\:%M\:%S`] Eclipse test run completed. " |
205 |
echo "[runtests] [`date +%H\:%M\:%S`] Eclipse test run completed. " |
| 200 |
|
206 |
|
|
|
207 |
# xwd -silent -display :${xport} -root -out /tmp/snap.xwd; # save a snapshot |
| 208 |
|
| 201 |
############################# END RUN TESTS ############################# |
209 |
############################# END RUN TESTS ############################# |
| 202 |
|
210 |
|
| 203 |
# supress errors by checking for the file first |
211 |
# drop X server process threads used by tests |
| 204 |
if [ -r /tmp/.X43-lock ] ; then |
212 |
if [[ -r /tmp/.X${xport}-lock ]]; then kill `cat /tmp/.X${xport}-lock`; fi |
| 205 |
kill `cat /tmp/.X43-lock` |
213 |
if [[ -f /tmp/.X${xport}-lock ]]; then rm -fr /tmp/.X${xport}-lock; fi |
| 206 |
fi |
|
|
| 207 |
if [ -r /tmp/.X42-lock ] ; then |
| 208 |
kill `cat /tmp/.X42-lock` |
| 209 |
fi |
| 210 |
|
214 |
|
| 211 |
if [[ ! -d $PWD/results ]]; then |
215 |
if [[ ! -d $PWD/results ]]; then |
| 212 |
echo "[relengbuild] No test results found in $PWD/results!"; |
216 |
echo "[relengbuild] No test results found in $PWD/results!"; |
|
Lines 215-226
Link Here
|
| 215 |
else |
219 |
else |
| 216 |
# if the build failed for some reason, don't clean up! |
220 |
# if the build failed for some reason, don't clean up! |
| 217 |
xmls=`find $PWD/results/xml -name "*.xml"`; |
221 |
xmls=`find $PWD/results/xml -name "*.xml"`; |
| 218 |
testsFailed=1; |
222 |
testsPassed="maybe"; |
| 219 |
for xml in $xmls; do |
223 |
for xml in $xmls; do |
| 220 |
if [ $testsFailed -eq 1 ]; then |
224 |
if [[ $testsPassed ]]; then |
| 221 |
testsFailed=`cat $xml | grep -c "<testsuite errors=\"0\" failures=\"0\""` |
225 |
testsPassed=$(cat $xml | grep "<testsuite " | grep " errors=\"0\"" | grep " failures=\"0\""); |
| 222 |
if [ $testsFailed -lt 1 ]; then |
226 |
if [[ ! $testsPassed ]]; then |
| 223 |
echo "[relengbuild] Found test failure(s) in $xml!"; |
227 |
echo "[relengbuild] Found test failure(s) in $xml: " |
|
|
228 |
echo " "$(cat $xml | grep "<testsuite "); |
| 224 |
echo "[relengbuild] Creating 'noclean' file to prevent cleanup after build completes." |
229 |
echo "[relengbuild] Creating 'noclean' file to prevent cleanup after build completes." |
| 225 |
echo "1" > $PWD/../../../noclean; |
230 |
echo "1" > $PWD/../../../noclean; |
| 226 |
break; |
231 |
break; |