Merge pull request #4015 from xmcclure/new-threads-collect-fix
[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"; fi
14
15 if [[ ${CI_TAGS} == *'checked-coop'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=gc,thread"; export MONO_CHECK_MODE=gc,thread; fi
16 if [[ ${CI_TAGS} == *'checked-all'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=all"; export MONO_CHECK_MODE=all; fi
17
18 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
19 if [[ ${label} == 'osx-amd64' ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib "; fi
20 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
21 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
22
23 if [[ ${CI_TAGS} == *'aot_only'* ]];
24     then
25     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=aot_only";
26 elif [[ ${CI_TAGS} == *'acceptance-tests'* ]];
27     then
28     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --prefix=${WORKSPACE}/tmp/mono-acceptance-tests --with-sgen-default-concurrent=yes";
29 elif [[ ${label} != w* ]] && [[ ${label} != 'debian-8-ppc64el' ]] && [[ ${label} != 'centos-s390x' ]] && [[ ${CI_TAGS} != *'monolite'* ]];
30     then
31     # Override the defaults to skip profiles
32     # only enable the mobile profiles and aot_only on the main architectures
33     # only enable the concurrent collector by default on main unix archs
34     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=all --with-sgen-default-concurrent=yes"
35 fi
36
37 if [ -x "/usr/bin/dpkg-architecture" ];
38         then
39         EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --host=`/usr/bin/dpkg-architecture -qDEB_HOST_GNU_TYPE`"
40         #force build arch = dpkg arch, sometimes misdetected
41         mkdir -p ~/.config/.mono/
42         wget -qO- https://download.mono-project.com/test/new-certs.tgz| tar zx -C ~/.config/.mono/
43 fi
44
45
46 ${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh $EXTRA_CONF_FLAGS
47 if [[ ${label} == 'w32' ]];
48     then
49         # only build boehm on w32 (only windows platform supporting boehm).
50     ${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
51 fi
52 if [[ ${label} == w* ]];
53     then
54     ${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
55 fi
56
57 if [[ ${CI_TAGS} == *'monolite'* ]]; then make get-monolite-latest; fi
58
59 make_parallelism=-j4
60 if [[ ${label} == 'debian-8-ppc64el' ]]; then make_parallelism=-j1; fi
61
62 ${TESTCMD} --label=make --timeout=300m --fatal make ${make_parallelism} -w V=1
63
64 if [[ ${CI_TAGS} == *'acceptance-tests'* ]];
65     then
66         $(dirname "${BASH_SOURCE[0]}")/run-test-acceptance-tests.sh
67 elif [[ ${CI_TAGS} == *'profiler-stress-tests'* ]];
68     then
69         $(dirname "${BASH_SOURCE[0]}")/run-test-profiler-stress-tests.sh
70 elif [[ ${CI_TAGS} == *'no-tests'* ]];
71     then
72         exit 0
73 else
74         make check-ci
75 fi