Subversion Repositories HomeAutomation

Rev

Rev 960 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. #!/bin/bash
  2.  
  3. # Author Erik Larsson, Anders Runeson
  4. # Date 2008-05-12, 2008-07-03
  5. #
  6. # This script builds default bios and if successful tries to build all the modules
  7.  
  8.  
  9. SCRIPTDIR=`dirname $0`
  10.  
  11. source ${SCRIPTDIR}/settings-modules.sh
  12.  
  13. PYTHON=/usr/bin/python
  14.  
  15. # Put log in separate file
  16. exec &> $LOGFILE
  17.  
  18.  
  19. STARTDATE=`date`
  20. echo "Starting $STARTDATE"
  21.  
  22. #Go to personal nodes
  23. cd $PERSONALPATH
  24.  
  25. if test -e "$TESTNODE"
  26. then
  27.     echo "Directory already exist you fool"
  28.     exit 0
  29. fi
  30.  
  31. echo "Export template to testing node"
  32. svn export template_module $TESTNODE
  33.  
  34. cd $TESTNODE
  35.  
  36. echo ""
  37. echo "#######################################"
  38. echo "Building BIOS"
  39. echo "#######################################"
  40. echo ""
  41.  
  42. if make bios
  43. then
  44.     echo ""
  45.     echo "#######################################"
  46.     echo "BIOS successful, continues with modules"
  47.     echo "#######################################"
  48.     echo ""
  49. else
  50.     echo ""
  51.     echo "#######################################"
  52.     echo "BIOS failed, stops testing"
  53.     echo "#######################################"
  54.     echo ""
  55.    
  56.     exit 0
  57. fi
  58.  
  59. successful=() # Array for successful builds
  60. failed=() # Array for failed builds
  61.  
  62. MODLIST=$($PYTHON ModuleManager -c)
  63. for module in $MODLIST; do
  64.  
  65.     echo; echo
  66.  
  67.     echo ""
  68.     echo "#######################################"
  69.     echo "Testing module $module"
  70.     echo "#######################################"
  71.     echo ""
  72.     echo "Adding module:"
  73.     $PYTHON ModuleManager --add=$module
  74.    
  75.     #get svn info of the application
  76.     echo "Svn info:"
  77.     cd ../../module/$module
  78.     svn info
  79.     cd ../../personal/$TESTNODE
  80.    
  81.     # Build
  82.     echo "Building:"
  83.     if make
  84.     then
  85.         echo ""
  86.         echo "#######################################"
  87.         echo "$module successful, continues with next module"
  88.         echo "#######################################"
  89.         echo ""
  90.        
  91.         successfull=( "${successfull[@]}" "$module\n" )
  92.  
  93.     else
  94.         echo ""
  95.         echo "#######################################"
  96.         echo "$module failed, continues with next module"
  97.         echo "#######################################"
  98.         echo ""
  99.        
  100.         failed=( "${failed[@]}" "$module\n" )
  101.     fi
  102.  
  103.     make clean
  104.     $PYTHON ModuleManager --del=$module
  105.     #rm src
  106.     #rm config.inc
  107.     #rm sources.inc
  108.    
  109.     continue # On to next module
  110.   echo
  111. done  
  112.  
  113.  
  114. # Remove test node after finished building
  115. cd ..
  116. rm -r "$TESTNODE"
  117.  
  118. ENDDATE=`date`
  119.  
  120. echo ""
  121. echo "#######################################"
  122. echo "Results"
  123. echo
  124. echo "Started $STARTDATE"
  125. echo "Finished $ENDDATE"
  126. echo
  127. echo "Successfull modules:"
  128. echo  -e ${successfull[@]}
  129. echo "Failed modules:"
  130. echo -e ${failed[@]}
  131. echo "#######################################"
  132. echo ""
  133.  
  134. if [ $DOPOSTIRC -eq "1" ] ; then
  135.     if [ ${#failed[@]} -ne "0" ] ; then
  136.         $POSTLINE \#hobby Tested to build modules, ${#failed[@]} failed, ${#successfull[@]} successfull, http://projekt.auml.se/homeautomation:software:embedded:last-build-mod-test
  137.     fi
  138. fi
  139.  
  140. exit 0
  141.  
  142.