revisionary.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/usr/local/bin/bash
  2. STARTREVISION=14033
  3. ENDREVISION=15268
  4. CURRENTREVISION=$STARTREVISION
  5. HOME_DIR='/home/gnunet/FreeBSD7-AMD64-wachs/freebsd7-amd64-wachs/build'
  6. CMD_UPDATE="svn up --force --accept theirs-full -r"
  7. CMD_CLEANUP="killall -s 31 -r gnunet-*; make distclean;"
  8. CMD_PREPARATION="./bootstrap; ./configure --prefix=/tmp/gnb --with-extractor=/usr/local"
  9. CMD_BUILD="make all"
  10. CMD_TEST="cd src/transport ; make test_transport_api_tcp; ./test_transport_api_tcp"
  11. #LOGGING=""
  12. LOGGING=" 1> /dev/null 2> errors.txt"
  13. LOGFILE="log.txt"
  14. output ()
  15. {
  16. eval echo $1
  17. eval echo $1 >> $LOGFILE
  18. }
  19. while [ $CURRENTREVISION -le $ENDREVISION ]; do
  20. output 'Testing revision $CURRENTREVISION'
  21. # updating
  22. output ' -> updating '
  23. eval cd $HOME_DIR
  24. CMD="$CMD_UPDATE $CURRENTREVISION $LOGGING"
  25. eval $CMD
  26. result=$?
  27. if [ $result -eq 0 ]; then
  28. output " updating OK"
  29. else
  30. output " updating FAILED"
  31. (( CURRENTREVISION++ ))
  32. continue
  33. fi
  34. # clean up
  35. output " -> cleanup "
  36. CMD="$CMD_CLEANUP $LOGGING"
  37. eval $CMD
  38. result=$?
  39. if [ $result -eq 0 ]; then
  40. output " cleanup OK"
  41. else
  42. output " cleanup FAILED"
  43. (( CURRENTREVISION++ ))
  44. continue
  45. fi
  46. # preparing
  47. output " -> preparation "
  48. CMD="$CMD_PREPARATION $LOGGING"
  49. #echo $CMD
  50. eval $CMD
  51. result=$?
  52. if [ $result -eq 0 ]; then
  53. output " preparation OK"
  54. else
  55. output " preparation FAILED"
  56. (( CURRENTREVISION++ ))
  57. continue
  58. fi
  59. # building
  60. output " -> building "
  61. CMD="$CMD_BUILD $LOGGING"
  62. #echo $CMD
  63. eval $CMD
  64. result=$?
  65. if [ $result -eq 0 ]; then
  66. output " building OK"
  67. else
  68. output " building FAILED"
  69. (( CURRENTREVISION++ ))
  70. continue
  71. fi
  72. # testing
  73. output " -> testing "
  74. CMD="$CMD_TEST $LOGGING"
  75. #echo $CMD
  76. eval $CMD
  77. result=$?
  78. testresult=result
  79. if [ $result -eq 0 ]; then
  80. output " testing OK"
  81. else
  82. output " testing FAILED"
  83. output 'Revision $CURRENTREVISION FAILED'
  84. fi
  85. (( CURRENTREVISION++ ))
  86. done
  87. exit