aboutsummaryrefslogtreecommitdiff
path: root/basebuilder-3.6.2/org.eclipse.releng.basebuilder/builderTemplate/tests/testScripts/runtests
blob: 5a3b1ea52458218f733b4314064f1d23105158ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# !/bin/sh

# by default, use the java executable on the path
vm=java

#set the DISPLAY for running tests on Linux
DISPLAY=`$HOST`:0.0;export DISPLAY

#this value must be set when using rsh to execute this script, otherwise the script will execute from the user's home directory
dir=.

# operating system, windowing system and architecture variables
os=
ws=
arch=

# list of tests (targets) to execute in test.xml
tests=

# default value to determine if eclipse should be reinstalled between running of tests
installmode="clean"

# name of a property file to pass to Ant
properties=

# message printed to console
usage="usage: $0 -os <osType> -ws <windowingSystemType> -arch <architecture> [-noclean] [<test target>][-properties <path>]"


# proces command line arguments
while [ $# -gt 0 ]
do
	case "$1" in
		-dir) dir="$2"; shift;;
		-os) os="$2"; shift;;
		-ws) ws="$2"; shift;;
		-arch) arch="$2"; shift;;
		-noclean) installmode="noclean";;
		-properties) properties="-propertyfile $2";shift;;
		-vm) vm="$2";shift;;
		*) tests=$tests\ $1;;
	esac
	shift
done

# for *nix systems, os, ws and arch values must be specified
if [ "x$os" = "x" ]
then
	echo >&2 "$usage"
	exit 1
fi

if [ "x$ws" = "x" ]
then
	echo >&2 "$usage"
	exit 1
fi

if [ "x$arch" = "x" ]
then
	echo >&2 "$usage"
	exit 1
fi

#necessary when invoking this script through rsh
cd $dir

# verify os, ws and arch values passed in are valid before running tests
if [ "$os-$ws-$arch" = "linux-motif-x86" ] || [ "$os-$ws-$arch" = "linux-gtk-x86" ] || [ "$os-$ws-$arch" = "solaris-motif-sparc" ] || [ "$os-$ws-$arch" = "solaris-gtk-sparc" ] || [ "$os-$ws-$arch" = "aix-motif-sparc" ] || [ "$os-$ws-$arch" = "hpux-motif-PA_RISC" ] || [ "$os-$ws-$arch" = "qnx-photon-x86" ]
then
	# Replace the boot eclipse (The eclipse used to run the main test.xml, this will start another eclipse later)
	rm -r eclipse
	rm -r workspace
	tar -xzf eclipse-SDK-*.tar.gz
	unzip -qq -o -C VE-junit-tests-*.zip */plugins/org.eclipse.test*
	
	if [ "$installmode" = "noclean" ]
	then		
		# if tests are to run without reinstalling eclipse, only install the test eclipse if it does not exist
		# If the test-eclipse directory is in a partially installed state, it should be deleted manually

		if [ ! -r test-eclipse/eclipse ]
		then
			 $vm -cp eclipse/startup.jar org.eclipse.core.launcher.Main -noupdate -ws $ws -os $os -arch $arch -application org.eclipse.ant.core.antRunner -file test.xml setup -Dws=$ws -Dos=$os -Darch=$arch -Dclean=true -logger org.apache.tools.ant.DefaultLogger
		fi
	fi

# run tests
$vm -cp eclipse/startup.jar -Dosgi.ws=$ws -Dosgi.os=$os -Dosgi.arch=$arch org.eclipse.core.launcher.Main -application org.eclipse.ant.core.antRunner -file test.xml $tests -Dws=$ws -Dos=$os -Darch=$arch -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger

# display message to user if os, ws and arch are invalid
else
	echo "The os, ws and arch values are either invalid or are an invalid combination"

exit 1
fi