X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/78c46677679a2dea291a739acdf387472c39e06d..b33bdec7b1eb6f5780141d3df13200c608d42ed7:/tools/jenkins/Flags.sh diff --git a/tools/jenkins/Flags.sh b/tools/jenkins/Flags.sh index 931a1359a6..40ac3013dc 100755 --- a/tools/jenkins/Flags.sh +++ b/tools/jenkins/Flags.sh @@ -1,7 +1,15 @@ -#!/bin/sh +#!/usr/bin/env sh set -e +if [ $# -lt 4 ] + then + echo "Needs 4 arguments : JAVA MC SMPI DEBUG" + exit -1 +fi + + + die() { echo "$@" exit 1 @@ -17,7 +25,16 @@ do_cleanup() { done } -### Cleanup previous runs +# Get an ON/OFF string from a command: +onoff() { + if "$@" > /dev/null ; then + echo ON + else + echo OFF + fi +} + +### Cleanup previous runs ! [ -z "$WORKSPACE" ] || die "No WORKSPACE" [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist" @@ -33,24 +50,46 @@ NUMPROC="$(nproc)" || NUMPROC=1 cd $WORKSPACE/build -for buildjava in ON OFF -do - for buildmalloc in ON OFF - do - for buildsmpi in ON OFF - do - for buildmc in ON OFF - do - echo "build with java=${buildjava}, mallocators=${buildmalloc}, SMPI=${buildsmpi}, MC=${buildmc}" - cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} \ - -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \ - -Denable_jedule=ON -Denable_mallocators=${buildmalloc} \ - -Denable_smpi=${buildsmpi} -Denable_smpi_MPICH3_testsuite=${buildsmpi} -Denable_model-checking=${buildmc} \ - -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=OFF -Denable_coverage=OFF $WORKSPACE - make -j$NUMPROC - make clean - done - done - done -done +#we can't just receive ON or OFF as values as display is bad in the resulting jenkins matrix + +if [ $1 = "JAVA" ] +then + buildjava="ON" +else + buildjava="OFF" +fi + +if [ $2 = "MC" ] +then + buildmc="ON" +else + buildmc="OFF" +fi + +if [ $3 = "SMPI" ] +then + buildsmpi="ON" +else + buildsmpi="OFF" +fi + +if [ $4 = "DEBUG" ] +then + builddebug="ON" +else + builddebug="OFF" +fi + + +echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}" +cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} \ + -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \ + -Denable_jedule=ON -Denable_mallocators=ON -Denable_debug=${builddebug} \ + -Denable_smpi=${buildsmpi} -Denable_smpi_MPICH3_testsuite=${buildsmpi} -Denable_model-checking=${buildmc} \ + -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=OFF \ + -Denable_ns3=$(onoff test "$buildmc" != "ON") -Denable_coverage=OFF $WORKSPACE + +make -j$NUMPROC +make clean +