Merge pull request #3563 from lewurm/interpreter
[mono.git] / scripts / ci / run-jenkins.sh
1 #!/bin/bash -e
2
3 export MONO_REPO_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd )"
4 export TESTCMD=${MONO_REPO_ROOT}/scripts/ci/run-step.sh
5
6 export TEST_HARNESS_VERBOSE=1
7
8 if [[ ${label} == w* ]]; then
9     # Passing -ggdb3 on Cygwin breaks linking against libmonosgen-x.y.dll
10     export CFLAGS="-g -O2"
11 else
12     export CFLAGS="-ggdb3 -O2"
13 fi
14
15 if [[ ${CI_TAGS} == *'coop-gc'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-cooperative-gc=yes"; fi
16
17 if [[ ${CI_TAGS} == *'checked-coop'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=gc,thread"; export MONO_CHECK_MODE=gc,thread; fi
18 if [[ ${CI_TAGS} == *'checked-all'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=all"; export MONO_CHECK_MODE=all; fi
19
20 if [[ ${CI_TAGS} == *'mcs-compiler'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-csc=mcs"; fi
21
22 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
23 if [[ ${label} == 'osx-amd64' ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib "; fi
24 if [[ ${label} == 'w32' ]]; then PLATFORM=Win32; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=i686-w64-mingw32"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/Win32/bin/Release/mono-sgen.exe"; fi
25 if [[ ${label} == 'w64' ]]; then PLATFORM=x64; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=x86_64-w64-mingw32 --disable-boehm"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/x64/bin/Release/mono-sgen.exe"; fi
26
27 if [[ ${CI_TAGS} == *'fullaot_llvm'* ]];
28     then
29     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=fullaot --enable-llvm=yes";
30 elif [[ ${CI_TAGS} == *'fullaot'* ]];
31     then
32     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=fullaot";
33 elif [[ ${CI_TAGS} == *'hybridaot_llvm'* ]];
34     then
35     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=hybridaot --enable-llvm=yes";
36 elif [[ ${CI_TAGS} == *'hybridaot'* ]];
37     then
38     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=hybridaot";
39 elif [[ ${CI_TAGS} == *'aot_llvm'* ]];
40     then
41     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=aot --enable-llvm=yes";
42 elif [[ ${CI_TAGS} == *'aot'* ]];
43     then
44     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=aot";
45 elif [[ ${CI_TAGS} == *'bitcode'* ]];
46     then
47     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=bitcode";
48 elif [[ ${CI_TAGS} == *'acceptance-tests'* ]];
49     then
50     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --prefix=${MONO_REPO_ROOT}/tmp/mono-acceptance-tests --with-sgen-default-concurrent=yes";
51 elif [[ ${label} != w* ]] && [[ ${label} != 'debian-8-ppc64el' ]] && [[ ${label} != 'centos-s390x' ]] && [[ ${CI_TAGS} != *'monolite'* ]];
52     then
53     # only enable the concurrent collector by default on main unix archs
54     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-sgen-default-concurrent=yes"
55
56     if [[ ${label} == 'ubuntu-1404-amd64' ]]; then
57         # only enable build of the additional profiles on one architecture to save time
58         EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=all"
59     fi
60 elif [[ ${CI_TAGS} == *'interpreter'* ]];
61     then
62     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-interpreter=yes";
63 fi
64
65 if [ -x "/usr/bin/dpkg-architecture" ];
66         then
67         EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --host=`/usr/bin/dpkg-architecture -qDEB_HOST_GNU_TYPE`"
68         #force build arch = dpkg arch, sometimes misdetected
69         mkdir -p ~/.config/.mono/
70         wget -qO- https://download.mono-project.com/test/new-certs.tgz| tar zx -C ~/.config/.mono/
71 fi
72
73
74 ${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh $EXTRA_CONF_FLAGS
75 if [[ ${label} == 'w32' ]];
76     then
77         # only build boehm on w32 (only windows platform supporting boehm).
78     ${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
79 fi
80 if [[ ${label} == w* ]];
81     then
82     ${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
83 fi
84
85 if [[ ${CI_TAGS} == *'monolite'* ]]; then make get-monolite-latest; fi
86
87 make_parallelism=-j4
88 if [[ ${label} == 'debian-8-ppc64el' ]]; then make_parallelism=-j1; fi
89
90 ${TESTCMD} --label=make --timeout=300m --fatal make ${make_parallelism} -w V=1
91
92 if [[ ${CI_TAGS} == *'acceptance-tests'* ]];
93     then
94         $(dirname "${BASH_SOURCE[0]}")/run-test-acceptance-tests.sh
95 elif [[ ${CI_TAGS} == *'profiler-stress-tests'* ]];
96     then
97         $(dirname "${BASH_SOURCE[0]}")/run-test-profiler-stress-tests.sh
98 elif [[ ${CI_TAGS} == *'interpreter'* ]];
99     then
100     $(dirname "${BASH_SOURCE[0]}")/run-test-interpreter.sh
101 elif [[ ${CI_TAGS} == *'no-tests'* ]];
102     then
103         exit 0
104 else
105         make check-ci
106 fi