Adding Visual namespace and Visual becomes Visual::Base
[platform/core/uifw/dali-toolkit.git] / automated-tests / build.sh
index d857de3..2f92135 100755 (executable)
@@ -1,70 +1,53 @@
 #!/bin/bash
 
-TEMP=`getopt -o 2vds: --long 2,verbose,desktop,scenario: \
-     -n 'build_out.sh' -- "$@"`
+
+TEMP=`getopt -o rn --long rebuild,no-gen \
+     -n 'genmake' -- "$@"`
 
 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
 
 # Note the quotes around `$TEMP': they are essential!
 eval set -- "$TEMP"
 
-scenario=all
-opt_verbose=0
-opt_env=scratchbox
+opt_rebuild=false
+opt_generate=true
 
 while true ; do
     case "$1" in
-       -d|--desktop)   opt_env=desktop ; shift ;;
-       -s|--scenario)  scenario="$2"   ; shift 2 ;;
-       -v|--verbose)   opt_verbose=1   ; shift ;;
-       -2|--2)         opt_env=sbs     ; shift ;;
-       --) shift ; break ;;
-       *) echo "Internal error!" ; exit 1 ;;
+        -r|--rebuild) opt_rebuild=true ; shift ;;
+        -n|--no-gen)  opt_generate=false ; shift ;;
+        --) shift ; break ;;
+        *) shift ;;   # Ignore
     esac
 done
 
+if [ false == $opt_rebuild -o ! -d "build" ] ; then
+    rm -rf build
+    mkdir build
+fi
 
-case "$opt_env" in
-    desktop)
-       . _export_desktop.sh
-       cat <<EOF > coverage.mk
-LDFLAGS += --coverage
-EOF
-       ;;
-    scratchbox)
-       . _export_env.sh
-       cat <<EOF > coverage.mk
-LDFLAGS +=
-EOF
-       ;;
-    sbs)
-       . _export_sbs.sh
-       cat <<EOF > coverage.mk
-LDFLAGS +=
-EOF
-       ;;
-esac
-
-
-echo PATH=$PATH
-echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
-echo TET_ROOT=$TET_ROOT
-echo TET_SUITE_ROOT=$TET_SUITE_ROOT
-echo ARCH=$ARCH
-
-RESULT_DIR=results-$ARCH
-HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
-
-# Faster cleanup.
-find . -name Makefile -execdir make -f {} clean \;
-
-mkdir -p $RESULT_DIR
-if [ $opt_verbose -eq 1 ] ; then
-    tcc -b -j -  ./  $scenario | tee $JOURNAL_RESULT
+function build
+{
+    if [ $opt_generate == true -o $opt_rebuild == false ] ; then
+        (cd src/$1; ../../scripts/tcheadgen.sh tct-$1-core.h)
+        if [ $? -ne 0 ]; then echo "Aborting..."; exit 1; fi
+    fi
+    (cd build ; cmake .. -DMODULE=$1 ; make -j7 )
+}
+
+if [ -n "$1" ] ; then
+  echo BUILDING ONLY $1
+  build $1
 else
-    tcc -b -j $JOURNAL_RESULT -p ./  $scenario
+  for mod in `ls -1 src/ | grep -v CMakeList `
+  do
+    if [ $mod != 'common' ] && [ $mod != 'manual' ]; then
+        echo BUILDING $mod
+        build $mod
+        if [ $? -ne 0 ]; then echo "Build failed" ; exit 1; fi
+    fi
+  done
 fi
-./tbp.pl $JOURNAL_RESULT
-
 
+echo "Build succeeded"
+exit 0