Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
as MC is mutually exclusive with NS3, move the test from coverage to flags.
[simgrid.git] / tools / jenkins / Flags.sh
1 #!/bin/sh
2
3 set -e
4
5 die() {
6     echo "$@"
7     exit 1
8 }
9
10 do_cleanup() {
11   for d in "$WORKSPACE/build"
12   do
13     if [ -d "$d" ]
14     then
15       rm -rf "$d" || die "Could not remote $d"
16     fi
17   done
18 }
19
20 # Get an ON/OFF string from a command:
21 onoff() {
22   if "$@" > /dev/null ; then
23     echo ON
24   else
25     echo OFF
26   fi
27 }
28
29 ###¬†Cleanup previous runs
30
31 ! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
32 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
33
34 do_cleanup
35
36 for d in "$WORKSPACE/build"
37 do
38   mkdir "$d" || die "Could not create $d"
39 done
40
41 NUMPROC="$(nproc)" || NUMPROC=1
42
43 cd $WORKSPACE/build
44
45 for buildjava in ON OFF
46 do
47   for builddebug in ON OFF
48   do
49     for buildsmpi in ON OFF
50     do
51       for buildmc in ON OFF
52       do
53         echo "build with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}"
54         cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} \
55               -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
56               -Denable_jedule=ON -Denable_mallocators=ON -Denable_debug=${builddebug} \
57               -Denable_smpi=${buildsmpi} -Denable_smpi_MPICH3_testsuite=${buildsmpi} -Denable_model-checking=${buildmc} \
58               -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=OFF 
59               -Denable_ns3=$(onoff test "$buildmc" != "ON") -Denable_coverage=OFF $WORKSPACE
60         make -j$NUMPROC
61         make clean
62       done
63     done
64   done
65 done 
66