run_tests.sh 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #!/bin/sh
  2. #
  3. # shell script for running the boost regression test suite and generating
  4. # a html table of results.
  5. # Set the following variables to configure the operation. Variables you
  6. # should set, i.e. usually required are listed first. Optional variables
  7. # have reasonable defaults for most situations.
  8. ### THESE SHOULD BE CHANGED!
  9. #
  10. # "boost_root" points to the root of you boost installation:
  11. # This can be either a non-exitent directory or an already complete Boost
  12. # source tree.
  13. #
  14. boost_root=$HOME/CVSROOTs/Boost/boost_regression
  15. #
  16. # Wether to fetch the most current Boost code from CVS (yes/no):
  17. # There are two contexts to use this script in: on an active Boost CVS
  18. # tree, and on a fresh Boost CVS tree. If "yes" is specified here an attempt
  19. # to fetch the latest CVS Boost files is made. For an active Boost CVS
  20. # the CVS connection information is used. If an empty tree is detected
  21. # the code is fetched with the anonymous read only information.
  22. #
  23. cvs_update=no
  24. #
  25. # "test_tools" are the Boost.Build toolsets to use for building and running the
  26. # regression tests. Specify a space separated list, of the Boost.Build toolsets.
  27. # Each will be built and tested in sequence.
  28. #
  29. test_tools=gcc
  30. #
  31. # "toolset" is the Boost.Build toolset to use for building the helper programs.
  32. # This is usually different than the toolsets one is testing. And this is
  33. # normally a toolset that corresponds to the compiler built into your platform.
  34. #
  35. toolset=gcc
  36. ### DEFAULTS ARE OK FOR THESE.
  37. #
  38. # "exe_suffix" the suffix used by exectable files:
  39. # In case your platform requires use of a special suffix for executables specify
  40. # it here, including the "." if needed. This should not be needed even in Windows
  41. # like platforms as they will execute without the suffix anyway.
  42. #
  43. exe_suffix=
  44. #
  45. # "bjam" points to your built bjam executable:
  46. # The location of the binary for running bjam. The default should work
  47. # under most circumstances.
  48. #
  49. bjam=$boost_root/tools/build/jam_src/bin/bjam$exe_suffix
  50. #
  51. # "process_jam_log", and "compiler_status" paths to built helper programs:
  52. # The location of the executables of the regression help programs. These
  53. # are built locally so the default should work in most situations.
  54. #
  55. process_jam_log=$boost_root/tools/regression/build/run/process_jam_log$exe_suffix
  56. compiler_status=$boost_root/tools/regression/build/run/compiler_status$exe_suffix
  57. #
  58. # "boost_build_path" can point to additional locations to find toolset files.
  59. #
  60. boost_build_path=$HOME/.boost-build
  61. ### NO MORE CONFIGURABLE PARTS.
  62. #
  63. # Some setup.
  64. #
  65. boost_dir=`basename $boost_root`
  66. export BOOST_BUILD_PATH=$boost_build_path $BOOST_BUILD_PATH
  67. #
  68. # STEP 0:
  69. #
  70. # Get the source code:
  71. #
  72. if test ! -d $boost_root ; then
  73. mkdir -p $boost_root
  74. if test $? -ne 0 ; then
  75. echo "creation of $boost_root directory failed."
  76. exit 256
  77. fi
  78. fi
  79. if test $cvs_update = yes ; then
  80. echo fetching Boost:
  81. echo "/1 :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/boost A" >> $HOME/.cvspass
  82. cat $HOME/.cvspass | sort | uniq > $HOME/.cvspass
  83. cd `dirname $boost_root`
  84. if test -f boost/CVS/Root ; then
  85. cvs -z3 -d `cat $boost_dir/CVS/Root` co -d $boost_dir boost
  86. else
  87. cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/boost co -d $boost_dir boost
  88. fi
  89. fi
  90. #
  91. # STEP 1:
  92. # rebuild bjam if required:
  93. #
  94. echo building bjam:
  95. cd $boost_root/tools/build/jam_src && \
  96. LOCATE_TARGET=bin sh ./build.sh
  97. if test $? != 0 ; then
  98. echo "bjam build failed."
  99. exit 256
  100. fi
  101. #
  102. # STEP 2:
  103. # rebuild the regression test helper programs if required:
  104. #
  105. echo building regression test helper programs:
  106. cd $boost_root/tools/regression/build && \
  107. $bjam -sTOOLS=$toolset -sBUILD=release run
  108. if test $? != 0 ; then
  109. echo "helper program build failed."
  110. exit 256
  111. fi
  112. #
  113. # STEP 5:
  114. # repeat steps 3 and 4 for each additional toolset:
  115. #
  116. for tool in $test_tools ; do
  117. #
  118. # STEP 3:
  119. # run the regression tests:
  120. #
  121. echo running the $tool regression tests:
  122. cd $boost_root/status
  123. $bjam -sTOOLS=$tool --dump-tests test 2>&1 | tee regress.log
  124. #
  125. # STEP 4:
  126. # post process the results:
  127. #
  128. echo processing the regression test results for $tool:
  129. cat regress.log | $process_jam_log
  130. if test $? != 0 ; then
  131. echo "Failed regression log post processing."
  132. exit 256
  133. fi
  134. done
  135. #
  136. # STEP 6:
  137. # create the html table:
  138. #
  139. uname=`uname`
  140. echo generating html tables:
  141. $compiler_status $boost_root cs-$uname.html cs-$uname-links.html
  142. if test $? != 0 ; then
  143. echo "Failed HTML result table generation."
  144. exit 256
  145. fi
  146. echo "done!"
粤ICP备19079148号