Subversion Repositories HomeAutomation

Rev

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

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