74f0d1bbf386169c651b16b7ff4828e506e0bf64
[mono.git] / scripts / ci / run-jenkins.sh
1 #!/bin/bash -e
2
3 TESTCMD=`dirname "${BASH_SOURCE[0]}"`/run-step.sh
4
5 export TEST_HARNESS_VERBOSE=1
6 if [[ ${label} == w* ]]; then
7     # Passing -ggdb3 on Cygwin breaks linking against libmonosgen-x.y.dll
8     export CFLAGS="-g -O2"
9 else
10     export CFLAGS="-ggdb3 -O2"
11 fi
12
13 if [[ ${CI_TAGS} == *'coop-gc'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-cooperative-gc=yes"; export MONO_CHECK_MODE=gc,thread; fi
14
15 if [[ ${label} == 'osx-i386' ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --build=i386-apple-darwin11.2.0"; fi
16 if [[ ${label} == 'osx-amd64' ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib "; fi
17 if [[ ${label} == 'w32' ]]; then PLATFORM=Win32; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=i686-w64-mingw32"; export MONO_EXECUTABLE="`cygpath -u ${WORKSPACE}\\\msvc\\\build\\\sgen\\\Win32\\\bin\\\Release\\\mono-sgen.exe`"; fi
18 if [[ ${label} == 'w64' ]]; then PLATFORM=x64; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=x86_64-w64-mingw32 --disable-boehm"; export MONO_EXECUTABLE="`cygpath -u ${WORKSPACE}\\\msvc\\\build\\\sgen\\\x64\\\bin\\\Release\\\mono-sgen.exe`"; fi
19
20 if [[ ${CI_TAGS} == *'mobile_static'* ]];
21     then
22     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=mobile_static";
23 elif [[ ${CI_TAGS} == *'acceptance-tests'* ]];
24     then
25     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --prefix=${WORKSPACE}/tmp/mono-acceptance-tests --with-sgen-default-concurrent=yes";
26 elif [[ ${label} != w* ]] && [[ ${label} != 'debian-ppc64el' ]] && [[ ${label} != 'centos-s390x' ]] && [[ ${CI_TAGS} != *'monolite'* ]];
27     then
28     # Override the defaults to skip profiles
29     # only enable the mobile profiles and mobile_static on the main architectures
30     # only enable the concurrent collector by default on main unix archs
31     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=all --with-sgen-default-concurrent=yes"
32 fi
33
34 if [ -x "/usr/bin/dpkg-architecture" ];
35         then
36         EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --host=`/usr/bin/dpkg-architecture -qDEB_HOST_GNU_TYPE`"
37         #force build arch = dpkg arch, sometimes misdetected
38 fi
39
40
41 ${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh $EXTRA_CONF_FLAGS
42 if [[ ${label} == 'w32' ]];
43     then
44         # only build boehm on w32 (only windows platform supporting boehm).
45     ${TESTCMD} --label=make-msvc --timeout=60m --fatal /cygdrive/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe /p:PlatformToolset=v140 /p:Platform=${PLATFORM} /p:Configuration=Release /p:MONO_TARGET_GC=boehm msvc/mono.sln
46 fi
47 if [[ ${label} == w* ]];
48     then
49     ${TESTCMD} --label=make-msvc-sgen --timeout=60m --fatal /cygdrive/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe /p:PlatformToolset=v140 /p:Platform=${PLATFORM} /p:Configuration=Release /p:MONO_TARGET_GC=sgen msvc/mono.sln
50 fi
51
52 if [[ ${CI_TAGS} == *'monolite'* ]]; then make get-monolite-latest; fi
53
54 ${TESTCMD} --label=make --timeout=300m --fatal make -j4 -w V=1
55 if [[ -n "${ghprbPullId}" ]] && [[ ${label} == w* ]];
56     then
57     exit 0
58     # we don't run the test suite on Windows PRs, we just ensure the build succeeds, so end here
59 fi
60
61 if [[ ${CI_TAGS} == *'acceptance-tests'* ]];
62     then
63         $(dirname "${BASH_SOURCE[0]}")/run-test-acceptance-tests.sh
64 elif [[ ${CI_TAGS} == *'profiler-stress-tests'* ]];
65     then
66         $(dirname "${BASH_SOURCE[0]}")/run-test-profiler-stress-tests.sh
67 else
68         make check-ci
69 fi